OpenVPN Reconnect Problem

How to customize and extend your OpenVPN installation.

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

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Thu May 19, 2011 2:24 pm

yes i have disabled UAC....

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Thu May 19, 2011 6:27 pm

.not working until i disable and enable adapter... ;(

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: OpenVPN Reconnect Problem

Post by janjust » Thu May 19, 2011 10:22 pm

try adding

Code: Select all

script-security 2
up "<path_to_up_script>"
up-restart
to the client config and restart the client....

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Fri May 20, 2011 8:57 am

path_to_up_script means path of batch file and name???

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: OpenVPN Reconnect Problem

Post by janjust » Fri May 20, 2011 9:22 am

yes, if you're using the openvpn GUI then you can assume a "Starting position" from

Code: Select all

c:\program files\openvpn\config
thus, if your script is in 'c:\program files\openvpn\scripts' then you can use

Code: Select all

up ..\\scripts\\hostizzle_pre.bat
make sure to change all backslashes to double backslashes, as done above.

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Fri May 20, 2011 9:34 am

I have done this check:

Code: Select all

script-security 2
up "C:\\Program Files (x86)\\OpenVPN\\config\\Hostizzle\\Hostizzle_pre.bat"
up-restart

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Fri May 20, 2011 9:36 am

got this error:

Code: Select all

Fri May 20 15:04:34 2011 OpenVPN 2.2.0 Win32-MSVC++ [SSL] [LZO2] built on Apr 26 2011
Fri May 20 15:04:34 2011 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Fri May 20 15:04:34 2011 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Fri May 20 15:04:34 2011 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:04:34 2011 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:04:34 2011 LZO compression initialized
Fri May 20 15:04:34 2011 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Fri May 20 15:04:34 2011 Socket Buffers: R=[8192->8192] S=[8192->8192]
Fri May 20 15:04:34 2011 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Fri May 20 15:04:34 2011 Local Options hash (VER=V4): '504e774e'
Fri May 20 15:04:34 2011 Expected Remote Options hash (VER=V4): '14168603'
Fri May 20 15:04:34 2011 UDPv4 link local: [undef]
Fri May 20 15:04:34 2011 UDPv4 link remote: 76.10.222.65:53
Fri May 20 15:04:35 2011 TLS: Initial packet from 76.10.222.65:53, sid=dffd9822 0b76e988
Fri May 20 15:04:36 2011 VERIFY OK: depth=1, /C=US/ST=OH/L=Columbus/O=Hostizzle/CN=Hostizzle_CA/emailAddress=hostizzle@gmail.com
Fri May 20 15:04:36 2011 VERIFY OK: nsCertType=SERVER
Fri May 20 15:04:36 2011 VERIFY OK: depth=0, /C=US/ST=OH/L=Columbus/O=Hostizzle/CN=server/emailAddress=hostizzle@gmail.com
Fri May 20 15:04:44 2011 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri May 20 15:04:44 2011 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:04:44 2011 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri May 20 15:04:44 2011 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:04:44 2011 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Fri May 20 15:04:44 2011 [server] Peer Connection Initiated with 76.10.222.65:53
Fri May 20 15:04:46 2011 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Fri May 20 15:04:46 2011 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway,dhcp-option DNS 8.8.8.8,ping 10,ping-restart 60,route 10.30.0.1,topology net30,ifconfig 10.30.3.54 10.30.3.53'
Fri May 20 15:04:46 2011 OPTIONS IMPORT: timers and/or timeouts modified
Fri May 20 15:04:46 2011 OPTIONS IMPORT: --ifconfig/up options modified
Fri May 20 15:04:46 2011 OPTIONS IMPORT: route options modified
Fri May 20 15:04:46 2011 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Fri May 20 15:04:46 2011 ROUTE default_gateway=10.3.88.32
Fri May 20 15:04:46 2011 TAP-WIN32 device [TAP-32] opened: \\.\Global\{FDB21102-33AB-42D6-8DD5-240594864F24}.tap
Fri May 20 15:04:46 2011 TAP-Win32 Driver Version 9.8 
Fri May 20 15:04:46 2011 TAP-Win32 MTU=1500
Fri May 20 15:04:46 2011 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.30.3.54/255.255.255.252 on interface {FDB21102-33AB-42D6-8DD5-240594864F24} [DHCP-serv: 10.30.3.53, lease-time: 31536000]
Fri May 20 15:04:46 2011 Successful ARP Flush on interface [23] {FDB21102-33AB-42D6-8DD5-240594864F24}
Fri May 20 15:04:46 2011 C:\Program Files (x86)\OpenVPN\config\Hostizzle\Hostizzle_pre.bat TAP-32 1500 1542 10.30.3.54 10.30.3.53 init
C:\Program Files (x86)\OpenVPN\config\Hostizzle>netsh interface set interface "TAP-32" DISABLE 
'netsh' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files (x86)\OpenVPN\config\Hostizzle>netsh interface set interface "TAP-32" ENABLE 
'netsh' is not recognized as an internal or external command,
operable program or batch file.
Fri May 20 15:04:47 2011 WARNING: Failed running command (--up/--down): returned error code 1
Fri May 20 15:04:47 2011 Exiting

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Fri May 20, 2011 9:38 am

Another Error Log After I Tell It Netsh Path:

Code: Select all

Fri May 20 15:07:34 2011 OpenVPN 2.2.0 Win32-MSVC++ [SSL] [LZO2] built on Apr 26 2011
Fri May 20 15:07:34 2011 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Fri May 20 15:07:34 2011 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Fri May 20 15:07:34 2011 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:07:34 2011 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:07:34 2011 LZO compression initialized
Fri May 20 15:07:34 2011 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Fri May 20 15:07:34 2011 Socket Buffers: R=[8192->8192] S=[8192->8192]
Fri May 20 15:07:34 2011 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Fri May 20 15:07:34 2011 Local Options hash (VER=V4): '504e774e'
Fri May 20 15:07:34 2011 Expected Remote Options hash (VER=V4): '14168603'
Fri May 20 15:07:34 2011 UDPv4 link local: [undef]
Fri May 20 15:07:34 2011 UDPv4 link remote: 76.10.222.65:53
Fri May 20 15:07:35 2011 TLS: Initial packet from 76.10.222.65:53, sid=f12b20eb 21470120
Fri May 20 15:07:36 2011 Replay-window backtrack occurred [2]
Fri May 20 15:07:37 2011 VERIFY OK: depth=1, /C=US/ST=OH/L=Columbus/O=Hostizzle/CN=Hostizzle_CA/emailAddress=hostizzle@gmail.com
Fri May 20 15:07:37 2011 VERIFY OK: nsCertType=SERVER
Fri May 20 15:07:37 2011 VERIFY OK: depth=0, /C=US/ST=OH/L=Columbus/O=Hostizzle/CN=server/emailAddress=hostizzle@gmail.com
Fri May 20 15:07:40 2011 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri May 20 15:07:40 2011 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:07:40 2011 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri May 20 15:07:40 2011 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:07:40 2011 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Fri May 20 15:07:40 2011 [server] Peer Connection Initiated with 76.10.222.65:53
Fri May 20 15:07:42 2011 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Fri May 20 15:07:42 2011 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway,dhcp-option DNS 8.8.8.8,ping 10,ping-restart 60,route 10.30.0.1,topology net30,ifconfig 10.30.3.54 10.30.3.53'
Fri May 20 15:07:42 2011 OPTIONS IMPORT: timers and/or timeouts modified
Fri May 20 15:07:42 2011 OPTIONS IMPORT: --ifconfig/up options modified
Fri May 20 15:07:42 2011 OPTIONS IMPORT: route options modified
Fri May 20 15:07:42 2011 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Fri May 20 15:07:42 2011 ROUTE default_gateway=10.3.88.32
Fri May 20 15:07:42 2011 TAP-WIN32 device [TAP-32] opened: \\.\Global\{FDB21102-33AB-42D6-8DD5-240594864F24}.tap
Fri May 20 15:07:42 2011 TAP-Win32 Driver Version 9.8 
Fri May 20 15:07:42 2011 TAP-Win32 MTU=1500
Fri May 20 15:07:42 2011 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.30.3.54/255.255.255.252 on interface {FDB21102-33AB-42D6-8DD5-240594864F24} [DHCP-serv: 10.30.3.53, lease-time: 31536000]
Fri May 20 15:07:42 2011 Successful ARP Flush on interface [23] {FDB21102-33AB-42D6-8DD5-240594864F24}
Fri May 20 15:07:42 2011 C:\Program Files (x86)\OpenVPN\config\Hostizzle\Hostizzle_pre.bat TAP-32 1500 1542 10.30.3.54 10.30.3.53 init
C:\Program Files (x86)\OpenVPN\config\Hostizzle>"C:\Windows\System32\netsh.exe" interface set interface "TAP-32" DISABLE 
C:\Program Files (x86)\OpenVPN\config\Hostizzle>"C:\Windows\System32\netsh.exe" interface set interface "TAP-32" ENABLE 
Fri May 20 15:07:47 2011 TUN/TAP interface has been stopped, exiting
Fri May 20 15:07:47 2011 TCP/UDP: Closing socket
Fri May 20 15:07:47 2011 Closing TUN/TAP interface
Fri May 20 15:07:47 2011 SIGTERM[soft,tun-stop] received, process exiting

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Fri May 20, 2011 9:40 am

I think its disabling tap adapter after doing connection to vpn server but that must done before doing connection.....

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: OpenVPN Reconnect Problem

Post by janjust » Fri May 20, 2011 9:44 am

I was afraid of that, but it was worth a try ;)
can you change
up "....."
to
down "....."
? I am not sure, however, if the 'down' script is called during a reconnect ...

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Fri May 20, 2011 9:53 am

Reconnecting Failed:

Code: Select all

Fri May 20 15:19:38 2011 OpenVPN 2.2.0 Win32-MSVC++ [SSL] [LZO2] built on Apr 26 2011
Fri May 20 15:19:38 2011 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Fri May 20 15:19:38 2011 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Fri May 20 15:19:38 2011 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:19:38 2011 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:19:38 2011 LZO compression initialized
Fri May 20 15:19:38 2011 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Fri May 20 15:19:38 2011 Socket Buffers: R=[8192->8192] S=[8192->8192]
Fri May 20 15:19:38 2011 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Fri May 20 15:19:38 2011 Local Options hash (VER=V4): '504e774e'
Fri May 20 15:19:38 2011 Expected Remote Options hash (VER=V4): '14168603'
Fri May 20 15:19:38 2011 UDPv4 link local: [undef]
Fri May 20 15:19:38 2011 UDPv4 link remote: 76.10.222.65:53
Fri May 20 15:19:38 2011 TLS: Initial packet from 76.10.222.65:53, sid=4d3b9466 8b4cd583
Fri May 20 15:19:40 2011 VERIFY OK: depth=1, /C=US/ST=OH/L=Columbus/O=Hostizzle/CN=Hostizzle_CA/emailAddress=hostizzle@gmail.com
Fri May 20 15:19:40 2011 VERIFY OK: nsCertType=SERVER
Fri May 20 15:19:40 2011 VERIFY OK: depth=0, /C=US/ST=OH/L=Columbus/O=Hostizzle/CN=server/emailAddress=hostizzle@gmail.com
Fri May 20 15:19:47 2011 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri May 20 15:19:47 2011 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:19:47 2011 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Fri May 20 15:19:47 2011 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Fri May 20 15:19:47 2011 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Fri May 20 15:19:47 2011 [server] Peer Connection Initiated with 76.10.222.65:53
Fri May 20 15:19:49 2011 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Fri May 20 15:19:50 2011 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway,dhcp-option DNS 8.8.8.8,ping 10,ping-restart 60,route 10.30.0.1,topology net30,ifconfig 10.30.3.54 10.30.3.53'
Fri May 20 15:19:50 2011 OPTIONS IMPORT: timers and/or timeouts modified
Fri May 20 15:19:50 2011 OPTIONS IMPORT: --ifconfig/up options modified
Fri May 20 15:19:50 2011 OPTIONS IMPORT: route options modified
Fri May 20 15:19:50 2011 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Fri May 20 15:19:50 2011 ROUTE default_gateway=10.3.88.32
Fri May 20 15:19:50 2011 TAP-WIN32 device [TAP-32] opened: \\.\Global\{FDB21102-33AB-42D6-8DD5-240594864F24}.tap
Fri May 20 15:19:50 2011 TAP-Win32 Driver Version 9.8 
Fri May 20 15:19:50 2011 TAP-Win32 MTU=1500
Fri May 20 15:19:50 2011 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.30.3.54/255.255.255.252 on interface {FDB21102-33AB-42D6-8DD5-240594864F24} [DHCP-serv: 10.30.3.53, lease-time: 31536000]
Fri May 20 15:19:50 2011 Successful ARP Flush on interface [23] {FDB21102-33AB-42D6-8DD5-240594864F24}
Fri May 20 15:19:55 2011 TEST ROUTES: 2/2 succeeded len=1 ret=1 a=0 u/d=up
Fri May 20 15:19:55 2011 C:\WINDOWS\system32\route.exe ADD 76.10.222.65 MASK 255.255.255.255 10.3.88.32
Fri May 20 15:19:55 2011 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Fri May 20 15:19:55 2011 Route addition via IPAPI succeeded [adaptive]
Fri May 20 15:19:55 2011 C:\WINDOWS\system32\route.exe DELETE 0.0.0.0 MASK 0.0.0.0 10.3.88.32
Fri May 20 15:19:55 2011 Route deletion via IPAPI succeeded [adaptive]
Fri May 20 15:19:55 2011 C:\WINDOWS\system32\route.exe ADD 0.0.0.0 MASK 0.0.0.0 10.30.3.53
Fri May 20 15:19:55 2011 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Fri May 20 15:19:55 2011 Route addition via IPAPI succeeded [adaptive]
Fri May 20 15:19:55 2011 C:\WINDOWS\system32\route.exe ADD 10.30.0.1 MASK 255.255.255.255 10.30.3.53
Fri May 20 15:19:55 2011 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Fri May 20 15:19:55 2011 Route addition via IPAPI succeeded [adaptive]
Fri May 20 15:19:55 2011 Initialization Sequence Completed
Fri May 20 15:22:04 2011 [server] Inactivity timeout (--ping-restart), restarting
Fri May 20 15:22:04 2011 TCP/UDP: Closing socket
Fri May 20 15:22:04 2011 C:\Program Files (x86)\OpenVPN\Scripts\Hostizzle_pre.bat TAP-32 1500 1542 10.30.3.54 10.30.3.53 restart
C:\Program Files (x86)\OpenVPN\config\Hostizzle>"C:\Windows\System32\netsh.exe" interface set interface "TAP-32" DISABLE 
C:\Program Files (x86)\OpenVPN\config\Hostizzle>"C:\Windows\System32\netsh.exe" interface set interface "TAP-32" ENABLE 
Fri May 20 15:22:06 2011 SIGUSR1[soft,ping-restart] received, process restarting
Fri May 20 15:22:06 2011 Restart pause, 2 second(s)
Fri May 20 15:22:08 2011 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Fri May 20 15:22:08 2011 Re-using SSL/TLS context
Fri May 20 15:22:08 2011 LZO compression initialized
Fri May 20 15:22:08 2011 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Fri May 20 15:22:08 2011 Socket Buffers: R=[8192->8192] S=[8192->8192]
Fri May 20 15:22:08 2011 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Fri May 20 15:22:08 2011 Local Options hash (VER=V4): '504e774e'
Fri May 20 15:22:08 2011 Expected Remote Options hash (VER=V4): '14168603'
Fri May 20 15:22:08 2011 UDPv4 link local: [undef]
Fri May 20 15:22:08 2011 UDPv4 link remote: 76.10.222.65:53
Fri May 20 15:22:08 2011 read from TUN/TAP : The I/O operation has been aborted because of either a thread exit or an application request.   (code=995)
Fri May 20 15:22:08 2011 TUN/TAP interface has been stopped, exiting
Fri May 20 15:22:08 2011 TCP/UDP: Closing socket
Fri May 20 15:22:08 2011 C:\WINDOWS\system32\route.exe DELETE 10.30.0.1 MASK 255.255.255.255 10.30.3.53
Fri May 20 15:22:08 2011 Warning: route gateway is not reachable on any active network adapters: 10.30.3.53
Fri May 20 15:22:08 2011 Route deletion via IPAPI failed [adaptive]
Fri May 20 15:22:08 2011 Route deletion fallback to route.exe
The route deletion failed: Element not found.
Fri May 20 15:22:08 2011 C:\WINDOWS\system32\route.exe DELETE 76.10.222.65 MASK 255.255.255.255 10.3.88.32
Fri May 20 15:22:08 2011 Warning: route gateway is not reachable on any active network adapters: 10.3.88.32
Fri May 20 15:22:08 2011 Route deletion via IPAPI failed [adaptive]
Fri May 20 15:22:08 2011 Route deletion fallback to route.exe
The route deletion failed: Element not found.
Fri May 20 15:22:08 2011 C:\WINDOWS\system32\route.exe DELETE 0.0.0.0 MASK 0.0.0.0 10.30.3.53
Fri May 20 15:22:08 2011 Warning: route gateway is not reachable on any active network adapters: 10.30.3.53
Fri May 20 15:22:08 2011 Route deletion via IPAPI failed [adaptive]
Fri May 20 15:22:08 2011 Route deletion fallback to route.exe
The route deletion failed: Element not found.
Fri May 20 15:22:08 2011 C:\WINDOWS\system32\route.exe ADD 0.0.0.0 MASK 0.0.0.0 10.3.88.32
Fri May 20 15:22:08 2011 Warning: route gateway is not reachable on any active network adapters: 10.3.88.32
Fri May 20 15:22:08 2011 Route addition via IPAPI failed [adaptive]
Fri May 20 15:22:08 2011 Route addition fallback to route.exe
 OK!
Fri May 20 15:22:08 2011 Closing TUN/TAP interface
Fri May 20 15:22:08 2011 C:\Program Files (x86)\OpenVPN\Scripts\Hostizzle_pre.bat TAP-32 1500 1542 10.30.3.54 10.30.3.53 init
C:\Program Files (x86)\OpenVPN\config\Hostizzle>"C:\Windows\System32\netsh.exe" interface set interface "TAP-32" DISABLE 
C:\Program Files (x86)\OpenVPN\config\Hostizzle>"C:\Windows\System32\netsh.exe" interface set interface "TAP-32" ENABLE 
Fri May 20 15:22:09 2011 SIGTERM[soft,tun-stop] received, process exiting

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: OpenVPN Reconnect Problem

Post by janjust » Fri May 20, 2011 10:49 am

hmmm it looks like this is not going to be possible :

- you need to run the tap32 start+stop during an OpenVPN GUI _pre script
- when the connection is dropped openvpn itself restarts and the GUI script is not used

there is also a _down script in the openvpn GUI - perhaps you can abuse that ? (I must add that I have not played with this myself).

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Fri May 20, 2011 11:48 am

:S so what i need to do actually.... :(

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: OpenVPN Reconnect Problem

Post by janjust » Fri May 20, 2011 2:28 pm

here's a last thing you could try

1) comment out the "up" or "down" script in the .ovpn file or remove the lines altogether
2) rename "Hostizzle_pre.bat" to "Hostizzle_down.bat" in the c:\program files (x86)\openvpn\config directory
3) restart the openvpn connection and wait for the disconnect

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Sun May 22, 2011 9:30 am

down batch file calling at the time of disconnect not reconnect... :(

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: OpenVPN Reconnect Problem

Post by janjust » Sun May 22, 2011 2:17 pm

then with your setup you are stuck - it is not normal that the tap-win32 needs to be reset after every connection; I don't know any other tricks to try.

Jeet Chowdhury
OpenVPN User
Posts: 26
Joined: Wed May 18, 2011 4:34 pm

Re: OpenVPN Reconnect Problem

Post by Jeet Chowdhury » Mon May 23, 2011 6:14 am

is this problem with windows 7?

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: OpenVPN Reconnect Problem

Post by janjust » Mon May 23, 2011 8:16 am

Most likely, yes; I've never heard of anyone having to reset the tap-win32 adapter after the VPN disconnects before. There are some low-level issues with tap-win32 (or tap-win64) on windows 7 . This might be one of them.

sssss
OpenVpn Newbie
Posts: 3
Joined: Sat May 21, 2011 1:28 pm

Re: OpenVPN Reconnect Problem

Post by sssss » Mon May 23, 2011 9:25 am

Hi janjust,

I am also having the same set-up as Jeet Chowdhury.

-> Windows7 -> Openvpn2.2 -RC2 -> Hostizzle (vpn service provider)

I am also in need to reconnection after ping-restart.

What I have found was its something with the route table the problem occurs.

I am having dynamic IP, so after each disconnect, we get a new ip and thus the route is getting not proper(via -ping-restart, after connection drop/rconnect

occurs). I think this is the problem. But once we disable and and enable the Tap device, the problem will be solved since route table are cleared (via

_pre.bat or _down.bat), I think so...

Note: the dns & ping-restart is being pulled from the hostizzle server

My nslookup at several intances of connection is as below :

Code: Select all

After connecting to ISP - nslookup (not connected to Hostizzle via openvpn)

C:\Users\admin>nslookup
Default Server:  dns-ntcl-p.tatacommunications.com
Address:  121.242.190.210

=================================
This was the settings pushed by Hostizzle

Mon May 23 14:07:28 2011 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Mon May 23 14:07:29 2011 PUSH: Received control message: 

'PUSH_REPLY,redirect-gateway,dhcp-option DNS 8.8.8.8,ping 10,ping-restart 

60,route 10.30.0.1,topology net30,ifconfig 10.30.7.166 10.30.7.165'

===================================
After connecting to Hostizzle server - nslookup

C:\Users\admin>nslookup
Default Server:  google-public-dns-a.google.com
Address:  8.8.8.8

==================================

When the internet connection was disconnected/dropped - nslookup (before Hostizzle ping-restart occurs)

C:\Users\admin>nslookup
DNS request timed out.
    timeout was 2 seconds.
Default Server:  UnKnown
Address:  8.8.8.8

====================================

After the internet link was again reconnectd and the Hostizzle connection was been made via soft-reset - nslookup

C:\Users\admin>nslookup
Default Server:  dns-ntcl-p.tatacommunications.com
Address:  121.242.190.210

===============================
So after the line has been dropped and connected, the route is not being properly updating for dns via openvpn(sigusr1)

Do we have any way to make the route again populated with 8.8.8.8 ?

Or can you please give a cmd command to issue signal for "re-connect(SIGUSR1)" the already started OpenGUI ?

so that I could utilize the _down.bat via this option

"remap-usr1 SIGTERM", in my .conf file.

So that the whole _down.bat will be like

Code: Select all

netsh interface set interface "TAP-32" DISABLE
netsh interface set interface "TAP-32" ENABLE
<reconnect command to OpenvpnGUI>
Or anyother better solution you have..

By the way,
It will reconnect to the Hostizzle server, after the line is being dropped, but the domainnames wont get resolved..Thats the main problem..

Thanks

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: OpenVPN Reconnect Problem

Post by janjust » Mon May 23, 2011 3:18 pm

I get the impression Hostizzle is doing something wrong...
I cannot reproduce this behaviour using a test setup with my win7 64bit laptop:
- assign a random IP to the client
- push "redirect-gateway" (it would be better if they added 'def1')
- push "dhcp-option DNS a.b.c.d"

every time the connection is restarted the right DNS server is picked up and the right routes are set.
Try adding

Code: Select all

register-dns
to the client config file to see if that helps in setting the correct DNS servers.

Post Reply