22

I have an OpenVPN config that I use on my Windows XP box and on my Ubuntu machine.

When I use it with my Windows machine, I can connect to the VPN and access sites on the VPN, and the internet as normal. When I use it on my Ubuntu box, when connected to the VPN, I can only access internal sites - No internet access at all.

I'm sure there is a way to configure OpenVPN on Ubuntu to allow internet connections, but I can't figure out how.

Jorge Castro
  • 71,754
user10669
  • 431

2 Answers2

33

Found it - The option is under "IPv4 Settings", "Routes", "Use this connection only for resources on its network".

  • Exactly, cos your vpn server config , push their route to you – Luciano Facchinelli Mar 06 '11 at 02:46
  • Please stick on using a single account. If the answer solves your problem, mark it as accepted. – Lekensteyn Mar 06 '11 at 10:38
  • Can't understand what you are suggesting. Where is "IPv4 Settings", "Routes" – Jayanga Kaushalya Mar 16 '13 at 20:03
  • 2
    @JKAUSHALYA in the Network Manager config, if you're editing the VPN connection, there are tabs for IPv4 and IPv6 settings. In those tabs, there is a button at the bottom labeled "Routes..." which brings up a window with the options referenced in this answer. – btleffler May 12 '14 at 17:05
  • 3
    @user11891 Not worked for me. The internet connection is working when I connect to the VPN, but now I can't access the VPN machines. – ayr-ton Oct 28 '14 at 17:24
  • For what its worth (and I have no idea why), the IPv6 equivalent setting worked for me (without the IPv4 setting), thanks :) – DevDave Jun 02 '16 at 20:37
11

VPN connection settings -> IPv4 Settings -> Routes

Check "Use this connection only for resources on its network".

Now if you can only access web sites but can't reach vpn network resources - you have to manually add routes to them (and maybe also check "Ignore automatically obtained routes")

For example I want to access resources on the vpn network with ips like 10.*.*.*, this configuration works for me:

enter image description here

Update for 18.04: gateway value is a must now, so enter "0.0.0.0"

Val
  • 441
  • 1
  • 7
  • 10