Stop Openvpn via command line

Hi. I set up Brian Hornsby’s addon on a vero 4K for my parents which has been working great. However, they do have a tendency to power their devices off at the switch and occasionally Brian Hornsby’s addon will fail to start the vpn connection in this scenario, which I wasn’t comfortable with. For that reason, I installed the vpn via the command line instead which is rock solid in this scenario. I set the vpn to auto start by editing /etc/default/openvpn and all works great. However, if I needed to stop the vpn connection, how would I go about it? Given my lack of knowledge, and that I already have autostart enabled, I’m wary of using systemctl stop/start commands as I’m not sure if this will create multiple instances of the vpn connection when starting up again. Thanks.

Hi,

sudo systemctl stop openvpn

Thanks Tom.

Thanks Tom. And would the autostart command already in /etc/default/openvpn then restart the vpn on reboot without having to issue any other commands?Thanks.

Hi,

Yes it should restart on reboot. I can advise how to start manually if you issue:

cat /etc/default/openvpn | paste-log

And post the link provided here.

Thanks Tom.

Brilliant Tom, thank you - that worked. Regarding starting manually, here is the log https://paste.osmc.tv/izedihirid

Hi,

You should be able to manually start openvpn with:

sudo systemctl start openvpn

The reason as I asked to see /etc/default/openvpn, I have instances where the above command doesn’t always initiate the vpn connection, a work around for this would to be to issue:

sudo systemctl stop openvpn && sudo systemctl start openvpn-client@pia_Ireland

To avoid multiple instances just sure you issue an stop, before start or just reboot.

Thanks Tom.

So helpful, thanks again.

1 Like