Debian, OpenVPN

Debian – connect to a VPN at startup

Edit openvpn default configuration

sudo nano /etc/default/openvpn

Uncomment AUTOSTART=”all”
or
Uncomment and edit the option AUTOSTART=”myhome” to auto-start only one vpn connection.

Copy your configuration

sudo cp /home/user/myhome.conf /etc/openvpn/myhome.conf

Don’t forget to change paths inside /etc/openvpn/myhome.conf file for certificate, key etc..

Reload

sudo systemctl daemon-reload

Restart Openvpn

sudo service openvpn restart