Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When setting up a test openvpn client on Ubuntu (using this guide), the client sets a route which tunnels all traffic through the vpn.

For example, when I connect to the vpn from Ubuntu, this is what netstat -nr shows:         UG        0 0          0 tun0 UGH       0 0          0 tun0 UH        0 0          0 tun0     U         0 0          0 tun0

I believe the first line is tunnelling everything through the vpn, correct? When I compare this to the output of the same command from my OSX machine:           UGSc            1        0    tun0            UH              2       33    tun0

I don't have that rule. Is there a way for me to push a command to delete that route from the client? What are my other options here?

share|improve this question

I assume you're using the NetworkManager GUI. It seems that its default behaviour is to override the default route, even if the OpenVPN server isn't pushing it.

You can fix that behaviour by editing the VPN connection and on the IPv4 settings tab select the 'Routes...' button. You'll see an option called 'Use this connection only for resources on this network'. Make sure that's enabled and then restart your VPN. That should sort you out.

share|improve this answer

Edit the respective lines in yor .ovpn file. You may need root rights (sudo) for this. You should have received the file whateveritiscalled.ovpn together with your certificates from your openvpn provider. Open the file with vi, gedit or another text editor and search for the lines below:

# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.

Under these lines you can add the IP and / or hostname of the route you want to use or is recommended by your vpn provider. Save the file.

share|improve this answer
This is quite vague. Can you explain how to do this? What are the "respective lines"? Where is the .ovpn file? – Eliah Kagan Feb 12 '13 at 11:15
I knew this much, my question was more geared towards "how" I should format the line(s) to add those rules in those files. – n0pe Feb 12 '13 at 11:35
I have edited my answer. Hope it is understandable. – speter Feb 12 '13 at 14:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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