tags:

views:

190

answers:

1

I have setup OpenVPN on my server, and I am able to connect to it just fine, and browse the web, etc, from the client box. If I set the following option in the client config, I can no longer browse the web via domain name:

redirect-gateway def1

On the server, I have run the following command:

iptables -t nat -s 10.8.0.0/24 -A POSTROUTING -j SNAT --to myserverIP

but that hasn't changed anything.

Can anyone help suggest something?

+2  A: 

Most likely this is because your DNS server is not on your local subnet, and you are overriding the default gateway, so DNS requests are being routed through the VPN link. I can think of two fixes off-hand:

  • Specify a DNS server in your VPN configuration that is reachable through the VPN.
  • Add a specific route on the client to the network hosting the DNS server, since the default route is being overridden by redirect-gateway.
Jeffrey Hantin
Hi Jeffrey -Your explanation makes sense... but let me ask something stupid then... which is, for each of your suggestions, how would I go about that?In the server.conf file I added the DNS servers of my server machine as well as:push "dhcp-option DNS 4.2.2.2"push "dhcp-option DNS 4.2.2.3"Wouldn't that do the trick?2) How would I add a specific route?
John