OpenVPN route all traffic via VPN

To add default route via VPN server add following lines into your server’s configuration file (usually /etc/openvpn/server.conf).

 push "redirect-gateway def1"
 push "dhcp-option DNS"

DNS option may be required, if you are having troubles with name resolution after connecting to VPN.

Leave a Reply

Your email address will not be published. Required fields are marked *