Disable/Enable TAP adapter

Instructions and tips on how to roll your own client installer.

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

Post Reply
sficca
OpenVpn Newbie
Posts: 7
Joined: Sat May 07, 2011 1:21 am

Disable/Enable TAP adapter

Post by sficca » Tue May 10, 2011 2:35 pm

I'd like to be able to "remove" the TAP adapter, but it hangs the system with no event log entry or bugcheck. Alternatively, I'd be happy to just "disable" the TAP adapter, but that hangs the system also with no event log entry or bugcheck. I need to do this because the ping through OpenVPN and TAP adapter yields, "PING: transmit failed, error code 1232" until I can disable/enable the TAP adapter. I'd like to be able to do that without having to get through a system hang or reboot.

(In trying to simplify the problem) I have disabled all other protocols bound to the TAP adapter but IPV4.

This is on Amazon EC2 "small" instance of Amazon's Windows Server 2008 x86 AMI (machine image w/ 1.7Gb RAM).
OpenVPN version 2.2.0 (also tried two previous versions)
TAP version: 9.0.0.8
Windows Server 2008 "Datacenter" build 6002 Service Pack 2

I've spent about 40 hours on this problem and would appreciate any help you could provide.

-John

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

Re: Disable/Enable TAP adapter

Post by krzee » Thu May 12, 2011 8:05 am

This seems to me like a different issue somewhere in your OS, or unique to it.
I just tested the old tap adapter in my XP virtual machine, and the new tap adapter from 2.2.0, both had no trouble disabling / enabling
you are not running openvpn while disabling the device, right?

sficca
OpenVpn Newbie
Posts: 7
Joined: Sat May 07, 2011 1:21 am

Re: Disable/Enable TAP adapter

Post by sficca » Thu May 12, 2011 11:52 am

Yes, I end the openvpnservice, the GUI app, and make sure there is no open* anything in the TaskManager.

I have been dumbing down my OS to find the root of this problem. As I said, eliminating QOS, IPv6, ... it "seemed" to work better ( I got it past a few cycles) with DHCP disabled - assigning the TAP 192.168.1.2 w/ GW ...1.1

reset-tap.bat:
----------------
net stop openvpnservice
netsh interface ip set address "TAP4CP" static 192.168.1.99 255.255.255.0 192.168.1.1 1
devcon DISABLE @ROOT\NET\0000
netsh interface ip set address name="TAP4CP" source=dhcp
devcon enable @ROOT\NET\0000
net start openvpnservice
---(end)---------

Although the above .bat worked three or four times, now it just hangs the virtual machine. By "hang", I mean causes it to loose RDP connection - it seems to respond only to a command from the Amazon EC2 Management Console to Reboot. Even a new instance hangs - so for a brief period of time, I had the machine configured such that it could endure a reset of the TAP device.

blackbird
OpenVpn Newbie
Posts: 1
Joined: Tue Aug 14, 2012 7:16 am

Re: Disable/Enable TAP adapter

Post by blackbird » Tue Aug 14, 2012 7:20 am

-If the TAP adapter does not show on the list in Windows Vista or 7, go to the Start Menu - OpenVPN - Utilities. Right click and run as administrator on 'Add a New Win 32 TAP Adapter'.

sficca
OpenVpn Newbie
Posts: 7
Joined: Sat May 07, 2011 1:21 am

Re: Disable/Enable TAP adapter

Post by sficca » Mon Apr 29, 2013 1:15 am

blackbird wrote:-If the TAP adapter does not show on the list in Windows Vista or 7, go to the Start Menu - OpenVPN - Utilities. Right click and run as administrator on 'Add a New Win 32 TAP Adapter'.
My TAP adapter does show in the list of adapters, but I followed your procedure to install another one, as Administrator. But the same hang happens, even when I disable it as Administrator, from a CMD box instantiated as Administrator while in fact logged in as Administrator:

Code: Select all

runas /user:Administrator "devcon disable @ROOT\NET\0002"
The system hangs, and requires a reboot after the line above, just as it does when I use the GUI to disable the TAP adapter.

sficca
OpenVpn Newbie
Posts: 7
Joined: Sat May 07, 2011 1:21 am

Re: Disable/Enable TAP adapter

Post by sficca » Mon Apr 29, 2013 3:46 pm

In a Windows Server 2008 SP2 32bit running in an Amazon EC2 “small” instance, after freshly performing a successful/complete Windows Update, I’ve uninstalled all anti-virus, uninstalled OpenVPN 2.2 (with the Uninstall.exe) and installed a fresh copy of OpenVPN 2.3.1 -- released on 2013.03.29.

In a “Command Prompt” run as Administrator, the following hangs the computer (instance):

Code: Select all

devcon disable @ROOT\NET\0000
The same thing happens when the GUI is used to simply Disable the TAP adapter – it hangs.
Please advise, hint or suggest in any way. Thanks!

Post Reply