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

I have a VPN connection on a server that must be connected at all times. I can make a connection, but I would like it to connect on boot, and if the connection drops it should reconnect automatically, preferably with some sort of notification that the connection has gone down but is now back up. The VPN is on OpenVPN.

What is the best way to do this?

share|improve this question
Actually there is an option "Connect automatically", but it doesn't seem to work. – lumbric Feb 7 '12 at 15:07

I assume you now have it configured with network manager under X.

But you can also configure a client-vpn-connecton in a config file and put it in /etc/openvpn/. Openvpn should start as a service when booting your client machine and start all configurations found.

From the quickstart guide on

The initscript will scan for .conf configuration files in /etc/openvpn, and if found, > will start up a separate OpenVPN daemon for each file.

Check out: openvpn Client Example Config and Ubuntu Communitu Documentation - OpenVPN more information.

share|improve this answer

protected by RolandiXor Feb 9 '12 at 15:45

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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