Automatic reconnection of OpenVpn in Windows XP ?

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Lexa
OpenVpn Newbie
Posts: 2
Joined: Sun Sep 05, 2010 5:03 pm

Automatic reconnection of OpenVpn in Windows XP ?

Post by Lexa » Sun Sep 05, 2010 5:11 pm

Hello all !

I would like to know if it's possible to get an automatic reconnection of OpenVpn in Windows XP , like a supervision script.

The script would supervise the OpenVPN connection , and if the OpenVpn connection down , the script would block all the traffic , or would stop a specific application which uses OpenVPN

My VPn provider have not a lot of deconnection , but it can happen ...

On Ubuntu , there is a very good daemon wich works very well. But on Windows i didn't found anything...

Tells me if you more explication

Thank you ;)

User avatar
krzee
Forum Team
Posts: 728
Joined: Fri Aug 29, 2008 5:42 pm

Re: Automatic reconnection of OpenVpn in Windows XP ?

Post by krzee » Tue Sep 07, 2010 3:17 am

openvpn by default will continue trying to reconnect.
you can run openvpn as a windows service to be in the background.
if you redirect your gateway to go over openvpn, if you do not use the def1 flag you will not have a route to the internet when openvpn is down.
Hope that helps!

Lexa
OpenVpn Newbie
Posts: 2
Joined: Sun Sep 05, 2010 5:03 pm

Re: Automatic reconnection of OpenVpn in Windows XP ?

Post by Lexa » Wed Sep 08, 2010 7:25 pm

Hi krzee , thx for your reply

So , it's fine if OpenVpn try to reconnect automatically , i 'm reassured.

Run openvpn as a Windows Service = OpenVpn in automatic mode , I'm right ?

However , i don't know what means ,"if you do not use the def1 flag"

Thx for your help ;)

User avatar
krzee
Forum Team
Posts: 728
Joined: Fri Aug 29, 2008 5:42 pm

Re: Automatic reconnection of OpenVpn in Windows XP ?

Post by krzee » Mon Sep 13, 2010 5:21 am

Lexa wrote: Run openvpn as a Windows Service = OpenVpn in automatic mode , I'm right ?
However , i don't know what means ,"if you do not use the def1 flag"
Thx for your help ;)
yes, when you run it as a service (and tell that service to start with windows) openvpn starts automatically.
http://openvpn.net/index.php/open-sourc ... pn-21.html
read --redirect-gateway
if you are using that command in order to send all internet traffic over the vpn, and do not use the def1 flag, you will not have a route to the internet when the VPN is down.

Freonpsandoz
OpenVpn Newbie
Posts: 6
Joined: Wed Jan 21, 2015 9:26 am

Re: Automatic reconnection of OpenVpn in Windows XP ?

Post by Freonpsandoz » Sun Feb 07, 2016 12:19 am

krzee wrote:openvpn by default will continue trying to reconnect.
you can run openvpn as a windows service to be in the background.
if you redirect your gateway to go over openvpn, if you do not use the def1 flag you will not have a route to the internet when openvpn is down.
Hope that helps!
In my case the "attempt" fails with the following log messages repeated FOREVER in the log file:

Sat Feb 06 14:45:57 2016 SIGUSR1[soft,tls-error] received, process restarting
Sat Feb 06 14:45:57 2016 MANAGEMENT: >STATE:1454798757,RECONNECTING,tls-error,,
Sat Feb 06 14:45:57 2016 Restart pause, 2 second(s)
Sat Feb 06 14:45:59 2016 Socket Buffers: R=[8192->8192] S=[8192->8192]
Sat Feb 06 14:45:59 2016 UDPv4 link local: [undef]
Sat Feb 06 14:45:59 2016 UDPv4 link remote: [AF_INET]5.45.72.83:25000
Sat Feb 06 14:45:59 2016 MANAGEMENT: >STATE:1454798759,WAIT,,,
Sat Feb 06 14:46:59 2016 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Sat Feb 06 14:46:59 2016 TLS Error: TLS handshake failed

1.Is there a way to configure OpenVPN so that the reconnect succeeds, or do I need to contact the VPN provider?

2. If I need to detect this situation and reconnect using a script, is it possible to force a disconnect and reconnect through the OpenVPN management interface? I don't see how this is done.

Thanks.

Post Reply