OpenVPN connection random disconnects
I have always had the problem of Random Disconnect with this provider/particular server. In order to get around manually restarting the service, I created a Cron Job at a particular time of day. However, since the disconnects occur randomly, I need a command to restart the connection rather than just start connection of its disconnected.
May 19 14:35:50 openvpn: AUTH: Received control message: AUTH_FAILED,SESSION: Your session has expired, please reauthenticate
May 19 14:35:50 openvpn: SIGTERM received, sending exit notification to peer
May 19 14:35:51 openvpn: /usr/local/sbin/ovpn-linkdown ovpnc2 1500 1542 126.96.36.199 255.255.255.192 init
May 19 14:35:51 openvpn: SIGTERM[soft,exit-with-notification] received, process exiting
I been keeping a journal on this matter for past 2 days, and notice it will drop connection after exactly 24 hours from when i restart service manually. So I believe setting Cron to Drop and then Reconnect will be the only reliable workaround.
here is the command im currently using : /usr/local/sbin/openvpn –config /var/etc/openvpn/client2.conf
But this command only starts service, how do i restart service?
as a side note: I have tried to troubleshoot this issue on openvpn forums, and tried various combinations of keepalive commands but this is of no help.Only thing i believe will help is Cron command every day.
try this in the advanced options config on the server:
May 29 10:12:23 openvpn: Initialization Sequence Completed<–------- Service Manually restarted
May 30 10:12:29 openvpn: AUTH: Received control message: AUTH_FAILED,SESSION: Your session has expired, please reauthenticate
openvpn: SIGTERM received, sending exit notification to peer /usr/local/sbin/ovpn-linkdown ovpnc2 1500 1542 x.x.x.x 255.255.255.192 init
May 30 10:12:30 SIGTERM[soft,exit-with-notification] received, process exiting<–- Service automatically disconnected
Exactly 24 hours after I restarted service
I see no option but to restart service from Cr0n after 24 hours/day
Try the reneg-sec option I mentioned before.
Also, post the entire config file here (less any private info), there may be a command in there that is preventing OpenVPN from automatically restarting as it usually does. In particular look at anything you've put into the "advanced options" box.
My reply is after adding that option and testing for however many days since your post. At first, it seemed to have done the trick but then I realized same problem exists.
Here is my config
#dhcp-option DNS x.x.x.x;
#dhcp-option DNS 188.8.131.52;
keepalive 10 60