TAP driver / identified vs unidentified networks
Hi. I'm running Win7 build 7000, trying to get both my OpenVPN connection and my coLinux connection (TAP-Win32 v9.0.0.4 and 8.0.0.4 respectively) to be identified as Home networks. Currently they each show as "Unidentified network" / "Local only" (sometimes even as participating in the same unidentified network.) "Local only" is correct, as I don't want to use them as default routes; and I certainly care that I can't name them, but I would like to figure out how to set things up so that I don't have to mark them as Home/Private networks every boot. What makes a network "unidentified"? Absence of a gateway? dhcpv6? I tried adding a connection-specific DNS suffix to each :) What makes a network identifiable? Thanks in advance for any information, Arya P.S. Here is what I assume is the relevant part of my ipconfig /all output: Ethernet adapter OpenVPN: Connection-specific DNS Suffix . : vpn Description . . . . . . . . . . . : TAP-Win32 Adapter V9 Physical Address. . . . . . . . . : 00-FF-D7-7A-74-AD DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::d166:3a1e:30b9:b2e1%20(Preferred) IPv4 Address. . . . . . . . . . . : 10.18.0.12(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : Thursday, April 02, 2009 9:09:56 AM Lease Expires . . . . . . . . . . : Friday, April 02, 2010 9:09:56 AM Default Gateway . . . . . . . . . : DHCP Server . . . . . . . . . . . : 10.18.0.0 DHCPv6 IAID . . . . . . . . . . . : 520159191 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-11-63-E7-20-00-11-43-63-14-3D DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1 fec0:0:0:ffff::2%1 fec0:0:0:ffff::3%1 NetBIOS over Tcpip. . . . . . . . : Enabled Ethernet adapter coLinux: Connection-specific DNS Suffix . : colinux Description . . . . . . . . . . . : TAP-Win32 Adapter V8 (coLinux) Physical Address. . . . . . . . . : 00-FF-F0-51-BC-E3 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::cd23:57d3:f832:e433%18(Preferred) IPv4 Address. . . . . . . . . . . : 10.7.0.1(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : DHCPv6 IAID . . . . . . . . . . . : 453050352 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-11-63-E7-20-00-11-43-63-14-3D DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1 fec0:0:0:ffff::2%1 fec0:0:0:ffff::3%1 NetBIOS over Tcpip. . . . . . . . : Enabled
April 2nd, 2009 4:34pm
Hi Use this powershell script it makes necessary changes in registry i found it on the web looking for solution to the same problem under vmware network adapters and modified it to work with tap open vpn devices.
# see http://msdn2.microsoft.com/en-us/library/bb201634.aspx
#
# *NdisDeviceType
#
# The type of the device. The default value is zero, which indicates a standard
# networking device that connects to a network.
#
# Set *NdisDeviceType to NDIS_DEVICE_TYPE_ENDPOINT (1) if this device is an
# endpoint device and is not a true network interface that connects to a network.
# For example, you must specify NDIS_DEVICE_TYPE_ENDPOINT for devices such as
# smart phones that use a networking infrastructure to communicate to the local
# computer system but do not provide connectivity to an external network.
#
# Usage: run in an elevated shell (vista/longhorn) or as adminstrator (xp/2003).
#
# PS> .\fix-vmnet-adapters.ps1
# boilerplate elevation check
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = new-object Security.Principal.WindowsPrincipal $identity
$elevated = $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $elevated) {
$error = "Sorry, you need to run this script"
if ([System.Environment]::OSVersion.Version.Major -gt 5) {
$error += " in an elevated shell."
} else {
$error += " as Administrator."
}
throw $error
}
function confirm {
$host.ui.PromptForChoice("Continue", "Process adapter?", [Management.Automation.Host.ChoiceDescription[]]@("&No", "&Yes"), 0) -eq $true}
# adapters key
pushd 'hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}'
# ignore and continue on error
dir -ea 0 | % {
$node = $_.pspath
$desc = gp $node -name driverdesc
if ($desc -like "*TAP-Win*") {
write-host ("Found adapter: {0} " -f $desc.driverdesc)
if (confirm) {
new-itemproperty $node -name '*NdisDeviceType' -propertytype dword -value 1
}
}
}
popd
# disable/enable network adapters
gwmi win32_networkadapter | ? {$_.name -like "*TAP-Win*" } | % {
# disable
write-host -nonew "Disabling $($_.name) ... "
$result = $_.Disable()
if ($result.ReturnValue -eq -0) { write-host " success." } else { write-host " failed." }
# enable
write-host -nonew "Enabling $($_.name) ... "
$result = $_.Enable()
if ($result.ReturnValue -eq -0) { write-host " success." } else { write-host " failed." }
}
Jarek
Free Windows Admin Tool Kit Click here and download it now
April 4th, 2009 8:50pm
I thought I would offer another option, it is the same fix as the powershell one except it is a one liner for the command prompt, though it may need to be an administrative command prompt.
FOR /F "USEBACKQ" %A IN (`REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318} /K /F "*"`) DO (REG QUERY %A /V DriverDesc | (FIND "TAP-Win" && REG ADD %A /V *NdisDeviceType /T
REG_DWORD /D 1 /F))
You could also execute it directly from the Run window by adding "cmd /c" to the front,
or make it a batch file by replacing the "%A"s with "%%A"s
December 29th, 2010 11:35am