Page 1 of 1

Re: Route client internet traffic through normal internet

Posted: Thu Oct 20, 2016 4:26 am
by djago
I'm on the same boat as you. I need the VPN to only give access to the local network (mostly file server) and I don't want to route all my internet request to be handled by the VPN Server. Please, somebody can help us?

Re: Route client internet traffic through normal internet

Posted: Sun Oct 23, 2016 5:27 pm
by moatazelmasry
If you are using OpenVPN you can indeed redirect a certain hostname to go through the normal internet instead of of the VPN tunnel, like this:
route http://www.google.ca 255.255.255.255 net_gateway

http://serverfault.com/a/631048/114877

But what you want is the exact opposite. There's an option in OpenVPN which I can't really remember which would prevent any packet from being tunneled. After that you can add the route to your machine, so that only requested hostname/IPs are tunneled through your vpn server while the rest of the traffic goes untunneled.

Now which OpenVPN option prevents tunneling (changing the default gateway) boils down to two directives in your client:
--route-noexec and --route-nopull
These two options will just ignore the server's recommendation to change the routes. Full explaination here:
https://community.openvpn.net/openvpn/w ... ectGateway

Re: Route client internet traffic through normal internet

Posted: Thu Nov 17, 2016 5:38 am
by thisjun
Please increase metric value of physical NIC.