Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Normally I'm connected to the Internet with a VPN, but sometimes it fails and some programs may automatically start to use the default unsecure connection.

How do I disconnect all the internet until the VPN connection is back up? I want to make sure all the traffic goes exclusively over VPN.

share|improve this question

Tried unplugging the cable until VPN comes back up?

In any case you could delete all the Wired/Wireless connections that Network Manager has stored and just leave the VPN ones there with the "automatic" option activated so when VPN comes back up it will connect to it automatically.

enter image description here

Just to make my point a little more clear. In the Wired, Wireless, Mobile Broadband and DSL set any connections you might have there to not automatic (Remove the Connect Automatically check from the checkbox). Or to be more drastic remove the connection completely. The only one that should be in Connect Automatically is the VPN connection you have.

With this you should have a system that automatically connects to the VPN when it is available. When it disconnects the system will stay offline until the VPN comes back.

share|improve this answer
I'm looking for a solution to make it automatically (even if I'm not around the computer) – Bob Feb 23 '12 at 16:34
Then this one will work. Removing all other connections from the Wired/Wireless tabs in the network manager and leaving only the VPN one with the automatic setting will leave the PC in a state where it does not matter what other connections appear. It will connect to the VPN automatically when it appears again. – Luis Alvarado Feb 23 '12 at 16:35
So next I will have to manually add them back, connect back to VPN and remove the connections? – Bob Feb 23 '12 at 16:44
Or just simply leave them without the "Connect automatically". That way you do not need to delete them. Of course they will be in manual mode so you would need to click on them to connect them. The only one that should stay in "Connect automatically" would be the one about the VPN. If this helps remember to accept/upvote the answer. Only if it helps. – Luis Alvarado Feb 23 '12 at 16:47
It starts using the main connection after the VPN disconnects - same as before – Bob Feb 23 '12 at 16:54

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.