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.

Due to privacy issues I'd like Ubuntu to allow applications to send traffic to the Internet only when the VPN connection is established.

The thing is that there are some applications like Skype or Dropbox that will reconnect after the VPN connection is dropped for some reason. And I don't want that, I want them not to be able to.

Any way to do this?

share|improve this question
    
Possible duplicates here or here? –  Tom Brossman Jul 10 '12 at 19:02

1 Answer 1

Try this:

To get your default gateway IP, show your routes with the ip route list command.

Edit your main internet connection to remove the default route: in nm-connection-editor, edit your connection > IPv4 tab > Routes > check Use this connection only for resources on its network.

Then add a specific route to reach your VPN server via your gateway. This will allow your computer to reach only one IP on the internet: your VPN server, so that your VPN connection will still work. (in the Routes window, add a route like: Adress: VPN_SERVER_IP Netmask: 255.255.255.255 Gateway:GATEWAY_IP).

To allow internet access through your VPN, you may also need to edit the Routes of your VPN connection to uncheck "Use this connection only for resources on its network", or add a specific route for a custom gateway of your VPN.

nm-connection-editor edit routes screen

share|improve this answer
2  
This doesn't seem to work in Ubuntu 13.04. I simply can't connect to my OpenVPN if I follow these instructions. @Marc, could you update your instructions for the latest versino of Ubuntu? –  Hengjie Jan 25 at 9:07

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.