Page 1 of 1

How do I autostart openvpn?

Posted: Tue Feb 07, 2017 11:38 pm
by odreezy
I installed OpenVPN with dietpi-software. Is there a recommended way to autostart openvpn with my configuration on boot?

Here's how I start openvpn manually:

Code: Select all

openvpn --auth-nocache --config .vpn_conf/pia.ovpn

Re: How do I autostart openvpn?

Posted: Sat Feb 11, 2017 1:00 am
by odreezy
I tried following this post which says to:

Code: Select all

systemctl enable openvpn@<your configuration file name>
But that isn't right, because when I run it, I get an error:

Code: Select all

systemctl enable openvpn@/root/.vpn_conf/pia.ovpn                                                                             
Failed to execute operation: Invalid argument
But maybe openvn is already setup a service? (sorry - I'm not too familiar with systemctl).

Code: Select all

systemctl | ag 'openvpn'

openvpn.service            loaded active exited    OpenVPN service
openvpn@server.service     loaded active running   OpenVPN connection to server
system-openvpn.slice       loaded active active    system-openvpn.slice
It's worth pointing out that I started openvpn directly with --deamon mode prior to this.

That leaves me wondering:
- Why is systemctl showing some openvpn entries?
- What should I do to get openvpn booting with my conf on startup?