Page 1 of 1

What is the best way to automatically reconnect client if something worng with the network? Ubuntu 16 and 20

Posted: Fri Mar 04, 2022 1:56 pm
by glorsh66
I have two servers and two clients that are using OpenVPN.
What is the best option for the client to ensure that it will try to reconnect if something wrong with the network or server?


Right now I am using

sudo nano /etc/default/openvpn
AUTOSTART="all"

option to run the client at the startup. It seems to be working, but I don't know if a client will try to reconnect.
Because after I changed some settings on the server, and restarted the OpenVPN daemon the connection on the client stayed in the operational state.

Does OpenVPN check the connection status and try to reconnect if something wrong?
Does it ping the server? How is it implemented?
What configuration options are available?


What are the best options to ensure that the connection is up? (for ubuntu 16 and ubuntu 20, because I suppose there could be some differences in nmcli functionality)?

Re: What is the best way to automatically reconnect client if something worng with the network? Ubuntu 16 and 20

Posted: Fri Mar 04, 2022 2:29 pm
by TinCanTech
Use systemd.

Re: What is the best way to automatically reconnect client if something worng with the network? Ubuntu 16 and 20

Posted: Fri Mar 25, 2022 2:55 pm
by glorsh66
TinCanTech wrote:
Fri Mar 04, 2022 2:29 pm
Use systemd.
I tried to make my own service, but how will it know if the connection has been lost?

Re: What is the best way to automatically reconnect client if something worng with the network? Ubuntu 16 and 20

Posted: Fri Mar 25, 2022 3:02 pm
by TinCanTech
Openvpn provide systemd service files, use those.