Auto Reconnect after disconnection
Posted: Tue May 03, 2011 9:01 pm
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?
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?