How do I autostart openvpn? Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
odreezy

How do I autostart openvpn?

Post 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
Thanks!
odreezy

Re: How do I autostart openvpn?

Post 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?

Thanks.
Post Reply