3

O have small problem with routing and OpenVPN. After start of VPN connection all traffic goes through my OpenVPN server. But my server is behind ADSL router with 16/2 MBit Download/Upload speed. So i can get access to my internal servers but access to normal Internet is to slow.

But I'd like to make like this:enter image description here

As you see access to normal Internet is direct(without OpenVPN) and to my Internal server via OpenVPN.

How can i make it?

  • Client laptop: Ubuntu 12.04, 14.04
  • OpenVPN server Ubuntu 12.04
  • Is there a redirect-gateway option in client's OpenVPN config file? If yes, then remove it. – Eric Carvalho Jul 6 '15 at 16:34
  • Yes redirect-gateway is present in my OpenVPN config. If i disable this option can i still work with internal server? Or i need extra configuration edits on client? – UNIm95 Jul 6 '15 at 17:07
2

In the OpenVPN client configuration file, remove the redirect-gateway option to stop redirection of all the traffic through the VPN.

If the server doesn't automatically push to clients the route to its LAN, you will lose access to your private servers. As a work around you could add the option route <network> <netmask> to your configuration file. For example, if your private servers have IP addresses in the 192.168.0.0/24 network add the following:

route 192.168.0.0 255.255.255.0

That would force through the VPN all traffic whose destination is the 192.168.0.0/24 network.

  • 1
    Thanks! In Network manager I under VPN->Edit->IPv4->Routes i checked box Use this connection only for resources on it's network Next i added route for network. – UNIm95 Jul 6 '15 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.