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 8.8.8.8"

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