Page 1 of 1

Always on for Centos client machines

Posted: Mon Jul 15, 2013 7:39 pm
by useradmn
Hello everyone,


I've setup OpenVPN on my linux server and i'm able to connect to it perfectly. However, my remote machines- sometimes lose connection while out in the field. Does anyone know a way that I can set the connection to restart once it is dropped? I'm trying to achieve an always-on scenario.


I guess I could write a script to check if pinging is successful, then attempt to kill the process and restart it. But not sure if this the best or most efficient way of doing it.


I'm not the advanced expert, so show me some mercy. :D


Thanks,

Daniel

Re: Always on for Centos client machines

Posted: Mon Jul 15, 2013 9:01 pm
by mwandelaar
When openvpn is started via the startup-scripts, is automatically trying to reconnect when a connection is failed. Even when it's started manually it should try to reconnect.

This implies starting openvpn as a service.
I've found 2 good manuals to do so:
Manual 1 and Manual 2

Please give it a try. And when it failed, can you post the openvpn-log on the failed connection, where openvpn bails-out?

--edit--
As i forgot, do you have

Code: Select all

keepalive 10 60
(or other values) in your server-config?

Re: Always on for Centos client machines

Posted: Mon Jul 15, 2013 9:04 pm
by brendan
look at the keepalive and assorted ping/ping-restart directives.

Re: Always on for Centos client machines

Posted: Tue Jul 30, 2013 3:08 am
by useradmn
Thanks guys! That did it for me.


I appreciate the help.