Server Fault is a question and answer site for system and network administrators. 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

I have different tunnels that I configured using the network manager GUI.

When I login to my desktop, I'm connected to the internet without any tunnels. To connect to a tunnel, I usually click on the network manager tray icon > VPN connections > Some VPN

I need that done automatically on startup, so I need to know how to do that in the cli.

It would also be nice if I could make sure that no application connects to the internet before the connection is tunneled.

Any ideas?

I'm using Ubuntu 12 and openvpn.

share|improve this question
up vote 5 down vote accepted

You should have nmcli in that version

nmcli con list

That will list connections you have setup. Find the VPN one

nmcli con up uuid <uuid>
share|improve this answer
I tried this in the cli but it requires a secret: "no valid VPN secrets" – HappyDeveloper Jun 22 '12 at 17:10
I was executing this as root, therefore the secret was not available. I had to execute this as the user that was logged in. Thanks! – HappyDeveloper Jun 22 '12 at 17:26
I'm having the same issue, but when I try it as my normal user, I get Connection activation failed: Not authorized to control networking. Any ideas? – Jonathon Reinhart Jun 4 '15 at 0:55

This is what the OpenVPN HOWTO says: "If you install OpenVPN via an RPM package on Linux, the installer will set up an initscript. When executed, the initscript will scan for .conf configuration files in /etc/openvpn, and if found, will start up a separate OpenVPN daemon for each file.". Ubuntu is derived from Debian, and may have a different structure.

Check in /etc/openvpn if you have that dir and .conf files, then if you have in /etc/rc5.d/ a link to the initscript. To check if the tunnel is up, you may ping the other side of the vpn.

share|improve this answer

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.