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.
This is the error:
May 19 14:35:50 openvpn[16475]: AUTH: Received control message: AUTH_FAILED,SESSION: Your session has expired, please reauthenticate
May 19 14:35:50 openvpn[16475]: SIGTERM received, sending exit notification to peer
May 19 14:35:51 openvpn[16475]: /usr/local/sbin/ovpn-linkdown ovpnc2 1500 1542 25.0.3.187 255.255.255.192 init
May 19 14:35:51 openvpn[16475]: SIGTERM[soft,exit-with-notification] received, process exitingI 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:
reneg-sec 0;
-
May 29 10:12:23 openvpn[79655]: Initialization Sequence Completed<–------- Service Manually restarted
May 30 10:12:29 openvpn[79655]: AUTH: Received control message: AUTH_FAILED,SESSION: Your session has expired, please reauthenticate
openvpn[79655]: 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
auth-user-pass xxxx;
#route-gateway x.x.x.x;
#dhcp-option DNS x.x.x.x;
#dhcp-option DISABLE-NBT;
route-noexec;
#dhcp-option DNS 8.8.8.8;
#verb 6;
reneg-sec 0;
keepalive 10 60