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.
Thanks,
Daniel
Always on for Centos client machines
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
-
- OpenVpn Newbie
- Posts: 4
- Joined: Mon Jul 15, 2013 7:34 pm
-
- OpenVPN Super User
- Posts: 219
- Joined: Mon Nov 23, 2009 8:24 pm
Re: Always on for Centos client machines
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 (or other values) in your server-config?
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
-
- OpenVPN Power User
- Posts: 110
- Joined: Wed Oct 19, 2011 1:19 am
Re: Always on for Centos client machines
look at the keepalive and assorted ping/ping-restart directives.
-
- OpenVpn Newbie
- Posts: 4
- Joined: Mon Jul 15, 2013 7:34 pm
Re: Always on for Centos client machines
Thanks guys! That did it for me.
I appreciate the help.
I appreciate the help.