wiki:openvpn_installation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:openvpn_installation [2024/05/13 14:18] – [References] add shorewall doc link antisa | wiki:openvpn_installation [2025/03/03 16:15] (current) – [See also] add Revoke openvpn certificates antisa | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{tag> | + | {{tag> |
====== Openvpn installation ====== | ====== Openvpn installation ====== | ||
Line 129: | Line 129: | ||
You can now try running the openvpn on client and server like mentioned in Simple setup above. | You can now try running the openvpn on client and server like mentioned in Simple setup above. | ||
+ | |||
+ | ==== Redirecting traffic over VPN ==== | ||
+ | === Redirect all traffic === | ||
+ | In server.conf add | ||
+ | |||
+ | push " | ||
+ | |||
+ | |||
+ | In client.conf add: | ||
+ | redirect-gateway def1 | ||
+ | |||
+ | === Redirect only some IPs (aka Split tunnel) === | ||
+ | In server.conf add: | ||
+ | |||
+ | push "route 192.168.10.0 255.255.255.0" | ||
+ | push "route 192.168.20.0 255.255.255.0" | ||
+ | ... | ||
+ | |||
+ | Remove the redirect-gateway lines from conf. | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | [[https:// | ||
+ | </ | ||
+ | |||
+ | ===== Redirect DNS through VPN ===== | ||
+ | First uninstall any other DNS server/ | ||
+ | |||
+ | apt install dnsmasq | ||
+ | |||
+ | Now make the /// | ||
+ | |||
+ | nameserver ::1 | ||
+ | nameserver 127.0.0.1 | ||
+ | options trust-ad | ||
+ | |||
+ | You might need to [[https:// | ||
+ | |||
+ | In /// | ||
+ | |||
+ | listen-address=:: | ||
+ | interface=tun0 | ||
+ | # Google' | ||
+ | server=8.8.8.8 | ||
+ | server=8.8.4.4 | ||
+ | |||
+ | Adapt the listen-address IP to your VPN interface IP and interface as well and uncomment '' | ||
+ | |||
+ | In /// | ||
+ | |||
+ | ... | ||
+ | push " | ||
+ | push " | ||
+ | ... | ||
+ | | ||
+ | <WRAP center round info 60%> | ||
+ | If you run into problems with DNS not going through VPN in Windows installed as a VM in Virtualbox for example, you will need to disable automatic metric on VPN interface and set it to lower then the default Ethernet or wifi. To check open the powershell and type '' | ||
+ | {{ : | ||
+ | </ | ||
+ | |||
+ | ==== Resolve specific domains names to hard-coded IP ==== | ||
+ | Say you need to always resolve example.org to 1.2.3.4 address, you have two options. | ||
+ | |||
+ | 1. Add the resolution to /// | ||
+ | |||
+ | ... | ||
+ | 1.2.3.4 www.example.org example.org | ||
+ | |||
+ | 2. Remove the above from /// | ||
+ | address=/ | ||
+ | |||
+ | Also [[https:// | ||
===== Firewall setup ===== | ===== Firewall setup ===== | ||
Line 140: | Line 211: | ||
#ZONE | #ZONE | ||
net | net | ||
- | vpn tun0 | + | vpn |
</ | </ | ||
Line 202: | Line 273: | ||
====== See also ====== | ====== See also ====== | ||
* [[wiki: | * [[wiki: | ||
+ | * [[wiki: | ||
+ | * [[wiki: | ||
====== References ====== | ====== References ====== | ||
* https:// | * https:// | ||
Line 209: | Line 282: | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | * https:// | ||
+ | * [[https:// | ||
wiki/openvpn_installation.1715609895.txt.gz · Last modified: 2024/05/13 14:18 by antisa