Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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:

0.0.0.0         10.8.0.9        0.0.0.0         UG        0 0          0 tun0
10.8.0.1        10.8.0.9        255.255.255.255 UGH       0 0          0 tun0
10.8.0.9        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
169.254.0.0     0.0.0.0         255.255.0.0     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:

10.8.0.1/32        10.8.0.5           UGSc            1        0    tun0
10.8.0.5           10.8.0.6           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

2 Answers 2

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
1  
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. –  maxmackie Feb 12 '13 at 11:35
    
I have edited my answer. Hope it is understandable. –  speter Feb 12 '13 at 14:44

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

Your Answer

 
discard

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.