How to reserve your network adapter
configration without connecting?
检索词:网卡配置、不接网线、拔掉网线、网卡生效
keywords:network adapter configration、link state、Media
Sensing、connecting
今天老大在笔记本上配置了个vmware,用来安装linux,为了方便,笔记本当然不是随时都插着网线的,但拔掉网线之后,windows
xp里面的网卡的网络配置全部失效了,怎样才能够保证在不接网线的情况下是网卡设置生效呢?
在网上查了些文档,不是很多,绝大部分的解决办法是做一个自连的水晶头,然后插上(如果是千兆网卡还需要将网卡的配置改为100M),这种做法比较无聊啦,哈哈。当然也有解决方法是增加一个虚拟网卡,这个没试过,应该也可以的吧。
最后还是在msdn上找到了答案,其实只需要改动一个注册表值,让系统不检查网络的连接状态即可,具体操作如下:
打开注册表(regedit),找到以下键值:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters
增加一个DWORD项,项名为:DisableDHCPMediaSense,键值设为1,然后重启服务器即可。
原文内容参考如下:
Windows contains the “Media Sensing” feature. You may use
this feature on a Windows-based computer using Transmission Control
Protocol/Internet Protocol (TCP/IP) to detect whether your network
media is in a “link state.” A “link state” is defined as the
physical media connecting or inserting itself on the network. For
example, assuming a 10bt or 100bt physical media, Ethernet network
adapters and hubs typically have a “link” light to indicate the
current connection status. This is the same condition in which
Windows can detect a link. Whenever Windows detects a “down” state
on the media, it removes the bound protocols from that adapter
until it is detected as “up” again. There may be situations where
you may not want your network adapter to detect this state, and you
can configure this by editing the registry.
To prevent your network adapter from detecting the link state,
follow these steps.
Note NetBEUI and IPX do not recognize Media Sense.
| 1. | Use Registry Editor (Regedt32.exe) to view the following key in the registry:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters
Add the following registry value: Value Name: DisableDHCPMediaSense
Data Type: REG_DWORD -Boolean Value Data Range: 0, 1 (False, True) Default: 0 (False) Description: This parameter controls DHCP Media Sense behavior. If |
| 2. | Restart your computer. |
Note In Windows Server 2003, the function which controls
Media Sense was added to the cluster system. Even if the
DisableDHCPMediaSense is not set or 0 (False) is set in the
registry, the cluster system is changing Media Sense into disabled.
Then, because of the system which wants to make Media Sense enable,
the DisableClusSvcMediaSense registry value was introduced in the
SP1. You can set ON/OFF of the control function of the cluster
system by using the following registry subkey:
- Key: HKEY_LOCAL_MACHINE\Cluster\Parameters
- Value Name: DisableClusSvcMediaSense
- Data Type: REG_DWORD -Boolean
- Data Range: 0, 1 (False, True) - Default: 0 (False).
The DisableClusSvcMediaSense is default 0 (False). Therefore, the
control function is ON and Media Sense is disabled. You can set the
DisableClusSvcMediaSense to 1 (True). Then, the control function is
OFF. After that, you can use the DisableDHCPMediaSense registry to
set enable/disable of Media Sense. This is similar to the cluster
environment of the Windows 2000 Server.
Note If you disable the “Media Sensing” feature, you may
experience problems. For example, if you have a computer that has
two network adapters and you disable the “Media Sensing” feature,
if one network adapter does not work, it is unbound. Additionally,
if a default gateway is configured, associated routes are removed
so that all traffic goes through the other network adapter.
In another example, if the “Media Sensing” feature is disabled when
you disconnect the network cable from the computer, the “Local Area
Connection” icon in the notification area displays a “Network cable
is unplugged” status message. Additionally, you receive a “Media
State …..: Cable Disconnected” message when you run the
ipconfig command. However, in this case, the network adapter
is bound to TCP/IP. To verify that the network adapter is bound to
TCP/IP, view the route table. To view the route table, use the
route print command. The route table shows the IP address of
the network adapter. You can also use the ping command to
ping the IP address of your network adaptor to verify that the
network adapter is bound to TCP/IP.
Tags: adapter, configration, 网卡