Linux – OpenVPN client breaks remote access to web server

linuxnginxopenvpn

I have an issue where whenever I use OpenVPN client to connect to the remote server to (obviously) set up a VPN tunnel, I can no longer see my nginx server. I can connect on the local network but it seems like it's dropping any remote access to the nginx web server. The VPN tunnel works perfectly. The nginx works fine as long as OpenVPN client isn't running but it stops immediately if I set up the VPN session. Is this something that can be fixed via iptables or routing settings? The system is x86_64 Fedora 19; eth0 is the network card, and tun0 is the vpn interface. Thanks in advance!

Best Answer

The OpenVPN server is likely sending the push "redirect-gateway <if_name>" option to your clients.

In this situation, the client's default gateway is pointing through the VPN tunnel. If the network on the VPN server side of things is not configured to NAT traffic from the VPN clients back out to the internet, then the only hosts they'll be able to access are those directly accessible on the VPN server network.