I have a Ubuntu 16.04 server running OpenVPN (via UPD).
This works great, except once it connects to VPN, I get kicked out of the SSH connection, and the DNS/http connections no longer resolve.
This is as expected, but how do I still keep those connections working while having the server's outbound requests go through the VPN?
You have routing problem enabling OpenVPN. Lets assume you're connected to Internet through router with local IP 192.168.0.1 (IP of router in local network) and your SSH-server (you're connecting to) IP is 999.999.999.999. Then add the route:
If you have no success, just delete the rule:
and try this:
Where 192.168.0.12 is your local IP address, 192.168.0.0/24 - subnet of your local IP, 192.168.0.1 - IP of your router in the local network, eth0 - your network interface name.
If the problem hasn't gone away afterwards, delete rules replacing
add
withdel
and just tell more in comments about your network connections and configuration - as much as possible.P.S. The rules/routes above are temporary - until next reboot. To make it persistent, just add to your
/etc/network/interfaces
corresponding lines with leadingup
, for example:Read this: http://www.networkinghowtos.com/howto/adding-persistent-static-routes-on-ubuntu/