OPNsense Forum

Archive => 20.7 Legacy Series => Topic started by: sco01 on November 18, 2020, 09:46:47 PM

Title: Restart OpenVPN client
Post by: sco01 on November 18, 2020, 09:46:47 PM
I have a problem that I've been fighting with for quite some time.

I have two OPNsense instances connected via a site-2-site OpenVPN tunnel. Node1 is acting as a client to Node2. About once every month (sometimes more) I wake up to a monit alarm telling me that Node2 is down. This means that the OpenVPN client on Node1 has crashed and I have to start it again. Troubleshooting this has been hard as all I can see in the log on Node1 is "openvpn[78610]: Exiting due to fatal error". I figured there must be some way to monitor the service and try to start it automatically if it is down as a workaround and so I went down the monit path. All went well until I had to configure a start script for the service. Is there a way to stop/start the OpenVPN client command line? Alternatively: How can i troubleshoot the root cause to prevent it from happening in the first place? 
Title: Re: Restart OpenVPN client
Post by: amichel on November 19, 2020, 01:08:54 PM
Hi,
take a look here : https://forum.opnsense.org/index.php?topic=6979.0 (https://forum.opnsense.org/index.php?topic=6979.0)
hth
amichel
Title: Re: Restart OpenVPN client
Post by: sco01 on November 19, 2020, 04:55:58 PM
Thanks. I had in fact tried the suggestion in that post but without success. The problem is that:

/usr/local/etc/rc.d/client2 onestatus responds with client2 is not running when the client is up and running. The same applies for start and stop.

That thread is from 2018. Maybe something has changed since then?