Auto Connect OpenVPN Client Startup

How to have an OpenVPN client connect on system Startup. How to set up a persistant OpenVPN client connection.

Ensure *.conf file is located in /etc/openvpn/
*.ovpn files will not work, they will need to be renamed to *.conf.
Renaming a ovpen file to conf is ok and does work.

Edit /etc/default/openvpn

  • Ensure a similar line below exist.
  • Ensure the value does not have an extension.
  • Ensure the value matches the certificate name.

AUTOSTART=”ClientName”

Example: Lets say there is a client certificate called LocationB and the config/settings file is called LocationB.ovpn.
Copy LocationB.ovpn into /etc/openvpn/LocationB.conf
Then add a line into /etc/default/openvpn
AUTOSTART=”LocationB”