BUG: Windows netsh interface ipv6 delete address
Hi,
I get an error on latest release 2.3.3 (and previous ones), on windows 8.1.
NETSH: C:\WINDOWS\system32\netsh.exe interface ipv6 delete address OPENVPN 2a02:xxxx:xxxx:ffff::1000
ERROR: netsh command failed: returned error code 1
MANAGEMENT: Client disconnected
NETSH: command failed
Exiting due to fatal error
When I type on commande line (administrator):
netsh interface ipv6 delete address OPENVPN 2a02:xxxx:xxxx:ffff::1000 it fails with : "The system cannot find the file specified"
When I type on commande line (administrator):
"netsh interface ipv6 delete address OPENVPN 2a02:xxxx:xxxx:ffff::1000 store=active" windows removes the ipv6 address successfully from the interface.
I think address is set with store=active by openvpn therefore it must be deleted with store=active also which is not the default according to netsh usage :
[[store=]active|persistent]
One of the following values:
active: Address will disappear on next boot. Persistent (default): Address will be persistent.
Consequences :
- Openvpn never reconnects automatically (fatal error due to ipv6 delete failure)
- On (manual) reconnect openvpn adds a new ipv6 address but the old one is still prefered and ipv6 is not working any more.
- Ipv6 address is never removed from tun/tap interface and disappears only on reboot
Regards
Cédric
HI,
Quoted 1 line · Cedric
I get an error on latest release 2.3.3 (and previous ones), on windows 8.1.
How I hate windows... the very same netsh call is working perfectly fine on XP, Vista, Win7 (no idea about 8, won't touch that).
As I have *so* no time to test on all these windows versions - could someone verify for me that the "netsh int ipv6 delete..." call will work fine with "store=active" on all the older platforms as well? Then I could do a 2.3.4 with that change fairly quickly...
gert
Signature · 9 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Quoted 6 lines · Cedric
Quoted 1 line
I get an error on latest release 2.3.3 (and previous ones), on windows 8.1.
How I hate windows... the very same netsh call is working perfectly fine on XP, Vista, Win7 (no idea about 8, won't touch that).
I confirm delete works with store=active on win7
I don't have access to a vista or XP to test right now :(
Cedric
Quoted 10 lines · Cedric
Quoted 6 lines · Cedric
Quoted 1 line
I get an error on latest release 2.3.3 (and previous ones), on windows 8.1.
How I hate windows... the very same netsh call is working perfectly fine on XP, Vista, Win7 (no idea about 8, won't touch that).
I confirm delete works with store=active on win7
I don't have access to a vista or XP to test right now :(
I just installed a windows XP SP3 in a VM, activated ipv6, connected the vpn and ran the netsh delete command by hand in a terminal with store=active.
It works without error, ipv6 address is removed from tun/tap interface.
I do not have the skills (and enough aspirin) to compile openvpn on windows, but I can test a beta if you can provide me a patched openvpn windows executable (32bit for winxp / 64bit for win7-8).
Cedric
Hi,
Quoted 4 lines · Cedric
I just installed a windows XP SP3 in a VM, activated ipv6, connected the vpn and ran the netsh delete command by hand in a terminal with store=active.
It works without error, ipv6 address is removed from tun/tap interface.
Thanks. This settles it :-) - I'll change the code, and provide a fix.
Quoted 3 lines
I do not have the skills (and enough aspirin) to compile openvpn on windows, but I can test a beta if you can provide me a patched openvpn windows executable (32bit for winxp / 64bit for win7-8).
As if I would want to remember...
(It's not *that* bad actually, with the new build system)
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Hiya,
Quoted 3 lines · Cedric
I get an error on latest release 2.3.3 (and previous ones), on windows 8.1.
NETSH: C:\WINDOWS\system32\netsh.exe interface ipv6 delete address OPENVPN 2a02:xxxx:xxxx:ffff::1000
So. here we go :-)
Patch (for 2.3.3, but should apply as well to master) is appended.
Windows installers for x32 and x64 can be found here:
http://www.greenie.net/ipv6/openvpn-install-2.3.3-routefix-I099-i686.exe
http://www.greenie.net/ipv6/openvpn-install-2.3.3-routefix-I099-x86_64.exe
Please test, and report if that fixes it for you.
The sources in there are "pristine 2.3.3 plus the appended patch", built with pkcs11-helper 1.11 and openssl 1.0.1g.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...From fce0349d035b77e738cb19856d05d92f8cc907bd Mon Sep 17 00:00:00 2001
From: Gert Doering <[email protected]...>
Date: Sun, 13 Apr 2014 13:12:02 +0200
Subject: [PATCH] IPv6 route delete fix for Win8
Use "store=active" for IPv6 route deletion as well - seems to be required on Windows 8 and up, and will break OpenVPN reconnection, as old routes are not properly deleted, thus new routes cannot be added.
--- src/openvpn/route.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
src/openvpn/route.c +7 -1
@@ -1974,10 +1974,16 @@ delete_route_ipv6 (const struct route_ipv6 *r6, const struct tuntap *tt, unsigneargv_printf_cat (&argv,"METRIC %d" , r->metric);#endif +/* Windows XP to 7 "just delete" routes, wherever they came from, but +* in Windows 8(.1?), if you create them with "store=active", this is +* how you have to delete them as well (pointed out by Cedric) +*/ +argv_printf_cat ( &argv," store=active" ); +argv_msg (D_ROUTE , &argv);netcmd_semaphore_lock (); -openvpn_execve_check (&argv, es,0 ,"ERROR: Windows route add ipv6 command failed" ); +openvpn_execve_check (&argv, es,0 ,"ERROR: Windows route delete ipv6 command failed" );netcmd_semaphore_release ();#elif defined (TARGET_SOLARIS)
Signature · 1 line
1.8.3.2
Hi,
Bug is still there in this build,
I think you patched the route removal but not the ipv6 address removal on the interface itself.
Cédric
Quoted 68 lines · Gert Doering
Hiya,
Quoted 3 lines · Cedric
I get an error on latest release 2.3.3 (and previous ones), on windows 8.1.
NETSH: C:\WINDOWS\system32\netsh.exe interface ipv6 delete address OPENVPN 2a02:xxxx:xxxx:ffff::1000
So. here we go :-)
Patch (for 2.3.3, but should apply as well to master) is appended.
Windows installers for x32 and x64 can be found here:
http://www.greenie.net/ipv6/openvpn-install-2.3.3-routefix-I099-i686.exe
http://www.greenie.net/ipv6/openvpn-install-2.3.3-routefix-I099-x86_64.exePlease test, and report if that fixes it for you.
The sources in there are "pristine 2.3.3 plus the appended patch", built with pkcs11-helper 1.11 and openssl 1.0.1g.
gert
Signature · 19 lines
USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany [email protected]... fax: +49-89-35655025 [email protected]... From fce0349d035b77e738cb19856d05d92f8cc907bd Mon Sep 17 00:00:00 2001 From: Gert Doering <[email protected]...> Date: Sun, 13 Apr 2014 13:12:02 +0200 Subject: [PATCH] IPv6 route delete fix for Win8 Use "store=active" for IPv6 route deletion as well - seems to be required on Windows 8 and up, and will break OpenVPN reconnection, as old routes are not properly deleted, thus new routes cannot be added. Reported-by: Cedric <[email protected]...> Signed-off-by: Gert Doering <[email protected]...> --- src/openvpn/route.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)src/openvpn/route.c +7
-1@@ -1974,10 +1974,16 @@ delete_route_ipv6 (const struct route_ipv6 *r6, const struct tuntap *tt, unsigneargv_printf_cat (&argv,"METRIC %d" , r->metric);#endif +/* Windows XP to 7 "just delete" routes, wherever they came from, but +* in Windows 8(.1?), if you create them with "store=active", this is +* how you have to delete them as well (pointed out by Cedric) +*/ +argv_printf_cat ( &argv," store=active" ); +argv_msg (D_ROUTE , &argv);netcmd_semaphore_lock (); -openvpn_execve_check (&argv, es,0 ,"ERROR: Windows route add ipv6 command failed" ); +openvpn_execve_check (&argv, es,0 ,"ERROR: Windows route delete ipv6 command failed" );netcmd_semaphore_release ();#elif defined (TARGET_SOLARIS)Signature · 1 line
1.8.3.2
Hi,
Quoted 3 lines · Cedric Tabary
Bug is still there in this build,
I think you patched the route removal but not the ipv6 address removal on the interface itself.
Oh. I need to learn to read... indeed, I patched route removal only.
Will send a new patch + installer tonight.
Sorry,
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Hi,
Quoted 3 lines · Cedric Tabary
Bug is still there in this build,
I think you patched the route removal but not the ipv6 address removal on the interface itself.
Next try. Thanks for your patience :-) - this patch + installer do the "store=active" both on the "address delete" and on the "route delete", so it would be good to know that it works on both ends of the spectrum, Win XP and Win 8.1
http://www.greenie.net/ipv6/openvpn-install-2.3.3-win8fix-I100-i686.exe
http://www.greenie.net/ipv6/openvpn-install-2.3.3-win8fix-I100-x86_64.exe
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...From ee4a33029d1aafd1aa3c85f0317a93612c03ea1a Mon Sep 17 00:00:00 2001
From: Gert Doering <[email protected]...>
Date: Sun, 13 Apr 2014 13:12:02 +0200
Subject: [PATCH] IPv6 address/route delete fix for Win8
Use "store=active" for IPv6 address and route deletion - seems to be required on Windows 8 and up, and not doing it will break OpenVPN reconnection (old addresses are not properly deleted, thus address can not be configured on connect).
--- src/openvpn/route.c | 8 +++++++- src/openvpn/tun.c | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-)
src/openvpn/route.c +7 -1
@@ -1974,10 +1974,16 @@ delete_route_ipv6 (const struct route_ipv6 *r6, const struct tuntap *tt, unsigneargv_printf_cat (&argv,"METRIC %d" , r->metric);#endif +/* Windows XP to 7 "just delete" routes, wherever they came from, but +* in Windows 8(.1?), if you create them with "store=active", this is +* how you should delete them as well (pointed out by Cedric Tabary) +*/ +argv_printf_cat ( &argv," store=active" ); +argv_msg (D_ROUTE , &argv);netcmd_semaphore_lock (); -openvpn_execve_check (&argv, es,0 ,"ERROR: Windows route add ipv6 command failed" ); +openvpn_execve_check (&argv, es,0 ,"ERROR: Windows route delete ipv6 command failed" );netcmd_semaphore_release ();#elif defined (TARGET_SOLARIS)
src/openvpn/tun.c +5 -1
@@ -5196,10 +5196,14 @@ close_tun (struct tuntap *tt)/* remove route pointing to interface */ delete_route_connected_v6_net (tt,NULL ); +/* "store=active" is needed in Windows 8(.1) to delete the +* address we added (pointed out by Cedric Tabary). +*/ +/* netsh interface ipv6 delete address \"%s\" %s */ ifconfig_ipv6_local =print_in6_addr (tt->local_ipv6,0 , &gc); argv_printf (&argv, - "%s%sc interface ipv6 delete address %s %s", + "%s%sc interface ipv6 delete address %s %s store=active", get_win_sys_path(), NETSH_PATH_SUFFIX, tt->actual_name,
Signature · 1 line
1.8.3.2
Hi,
This works perfectly on win8.1, win7 sp1 and winXP sp3 :)
Thank you
Cédric
Quoted 84 lines · Gert Doering
Hi,
Quoted 3 lines · Cedric Tabary
Bug is still there in this build,
I think you patched the route removal but not the ipv6 address removal on the interface itself.Next try. Thanks for your patience :-) - this patch + installer do the "store=active" both on the "address delete" and on the "route delete", so it would be good to know that it works on both ends of the spectrum, Win XP and Win 8.1
http://www.greenie.net/ipv6/openvpn-install-2.3.3-win8fix-I100-i686.exe
http://www.greenie.net/ipv6/openvpn-install-2.3.3-win8fix-I100-x86_64.exegert
Signature · 21 lines
USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany [email protected]... fax: +49-89-35655025 [email protected]... From ee4a33029d1aafd1aa3c85f0317a93612c03ea1a Mon Sep 17 00:00:00 2001 From: Gert Doering <[email protected]...> Date: Sun, 13 Apr 2014 13:12:02 +0200 Subject: [PATCH] IPv6 address/route delete fix for Win8 Use "store=active" for IPv6 address and route deletion - seems to be required on Windows 8 and up, and not doing it will break OpenVPN reconnection (old addresses are not properly deleted, thus address can not be configured on connect). Reported-by: Cedric <[email protected]...> Signed-off-by: Gert Doering <[email protected]...> --- src/openvpn/route.c | 8 +++++++- src/openvpn/tun.c | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-)src/openvpn/route.c +7
-1@@ -1974,10 +1974,16 @@ delete_route_ipv6 (const struct route_ipv6 *r6, const struct tuntap *tt, unsigneargv_printf_cat (&argv,"METRIC %d" , r->metric);#endif +/* Windows XP to 7 "just delete" routes, wherever they came from, but +* in Windows 8(.1?), if you create them with "store=active", this is +* how you should delete them as well (pointed out by Cedric Tabary) +*/ +argv_printf_cat ( &argv," store=active" ); +argv_msg (D_ROUTE , &argv);netcmd_semaphore_lock (); -openvpn_execve_check (&argv, es,0 ,"ERROR: Windows route add ipv6 command failed" ); +openvpn_execve_check (&argv, es,0 ,"ERROR: Windows route delete ipv6 command failed" );netcmd_semaphore_release ();#elif defined (TARGET_SOLARIS)src/openvpn/tun.c +5
-1@@ -5196,10 +5196,14 @@ close_tun (struct tuntap *tt)/* remove route pointing to interface */ delete_route_connected_v6_net (tt,NULL ); +/* "store=active" is needed in Windows 8(.1) to delete the +* address we added (pointed out by Cedric Tabary). +*/ +/* netsh interface ipv6 delete address \"%s\" %s */ ifconfig_ipv6_local =print_in6_addr (tt->local_ipv6,0 , &gc); argv_printf (&argv, - "%s%sc interface ipv6 delete address %s %s", + "%s%sc interface ipv6 delete address %s %s store=active", get_win_sys_path(), NETSH_PATH_SUFFIX, tt->actual_name,Signature · 1 line
1.8.3.2
Hi,
Quoted 1 line · Cedric Tabary
This works perfectly on win8.1, win7 sp1 and winXP sp3 :)
Cool. Thanks a lot for reporting and testing.
I'll try to get a 2.3.4 release out "soonish" with this one and the socks5 fix (and possibly the ssl library version reporting, depending on how that discussion goes).
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...[Openvpn-devel] [PATCH applied] Re: IPv6 address/route delete fix for Win8
In reply to Gert DoeringPatch has been applied to the master and release/2.3 branches.
commit 4b4fac9184fcea1eab4f4223309211780cee188a (master) commit 22e834bee82b046e753d74ee374299720d0ec0bb (release/2.3)
Author: Gert Doering Date: Sun Apr 13 13:12:02 2014 +0200
IPv6 address/route delete fix for Win8
Signed-off-by: Gert Doering <[email protected]...>
Acked-by: Cedric Tabary <[email protected]...>
Message-Id: <[email protected]...>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8499--
kind regards,
Gert Doering