News:

SMF - Just Installed!

Main Menu

OpenVPN start and reconnect automatically

Started by mahesh, Oct 17, 2023, 05:10 AM

Previous topic - Next topic

mahesh

Hi,
I would love to have OpenVPN start and try to connect after machine boots, and try to re-connect if disconnected.

Have tried (restarting machine after each change).

- Un-comment "AUTOSTART="all"" in /etc/default/openvpn file
- Add "--ping-restart 10" into /etc/openvpn/client/myvpn.conf file

If I do 'systemctl status openvpn' it is 'active (exited)'.

There are no log files in /var/log/openvpn, and I can't find anything useful in other logs, maybe I can increase log level somewhere?

I noticed that there is no openvpn in /etc/systemd/system, is this right as I thought service needs to be in here so it can know pre-requisite required (the 'wants' file)? I am new to Linux just trying to figure out how this works.
Thanks in advance, I have spent hours trying various things with hard luck.

ps. If I try to connect manually it works everytime.

Cheers,
Jay