I'm having a bit of an issue with my OpenVPN client. If for some reason it loses connectivity, whether it be an ISP issue, cable disconnection, or something else, the client doesn't automatically reconnect to the VPN. I need it to be able to automatically reconnect no matter how long it's been disconnected, or if the PC was booted up while the network was down.
I'm running on Windows and have written a vbs script that gets executed every 5 minutes from within my application.
The vbs file writes an "ipconfig" to a txt file then checks to see if the VPN IP address is in the txt file. If so it stops since it's connected to the VPN. If not, it executes the following:
c:\Program Files\OpenVPN Technologies\OpenVPN Client\core\openvpn --config vpnconfig.ovpn
It's unreliable though.
Is there a better way to make sure a client always tries to reconnect even if the network's gone down (and comes back up), or the client boots up while the network's down?
Auto Reconnect after disconnection
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 2
- Joined: Thu Apr 21, 2011 8:50 pm
- krzee
- Forum Team
- Posts: 728
- Joined: Fri Aug 29, 2008 5:42 pm
Re: Auto Reconnect after disconnection
use a keepalive
--keepalive in the manual
you may also need persist-key and persist-tun
--keepalive in the manual
you may also need persist-key and persist-tun