“For a complete guide to security, check out ””Security+ Study Guide and DVD Training System”” from Amazon.com“
What is Media Sensing?
Windows contains a “Media Sensing” feature. Although, many time Windows based operating systems do something to make your life easier, at times it also adds complication. Many times the only way to adjust such automatic features is to edit the Registry which is what we will be doing in this article.
Always make a backup of the Registry either manually or using System Restore before editing the Registry.
Windows 2000 (and continued with XP) introduced a media-sense feature into the OS that allowed for a NIC (Network Interface Card) to be able to detect if a network cable connected to it. You would see this pretty clearly as the OS came to life as you either plugged a cable into the port and/or removed it with the following Windows XP based illustration:
If the cable is disconnected, the Operating System will disable the protocols on the adapter. A loopback of 127.0.0.1 (in your HOSTS file) will still work. Also, note that TCP/IP is affected; NetBEUI and IPX do not recognize Media Sense.
This may be inconvenient for you if you are using applications that require IP connectivity to remain constant; you are using portables, or any other reason. You should be able to disable this feature if it is causing you issues.
When the network cable is disconnected, the operating system will show you a message as seen in the following illustration:
This message states that you have unplugged a cable, but what you may now know is that the OS disables the entire network protocol stack at the same time which is something you may not want to happen. The disabling of this stack will mean that you will not even be able to reach network addresses on your own system.
Is this Normal Behavior?
This is normal (default) behavior in both 2000 and XP. Media Sense (added into NDIS 5.0) was built into the system to do this exact function. It was initially developed from NT 4.0 where if you unplugged from one network segment and moved to another (example: you are plugged into a VLAN on 10.1.1.0 and move to another VLAN segment at 10.1.2.0) you would most likely have to refresh your settings with IPCONFIG /release /renew to get the new IP range from your DHCP server. With Media Sense, its nearly automatic, hence better movement ability for roaming users. This also conflicted with when you took a PC home and trying to dial in or use a network connection from home, you may still have old settings set into the stack. Media sensing is a good thing, this article just states why you may want to disable it.
How do you disable Media Sense?
Again, ensure that you have run a system restore or backed up our system before attempting to modify the system Registry. Since running a system restore is pretty simple and only requires you to follow a Wizard and have some extra disk space on your PC, it is highly recommended that you do so.
Follow these steps to disable Media Sense and the adapter from detecting link state:
- Launch the Registry editor. Start => Run => type Regedt32 => Enter
- Browse to the following key in the Registry:
- Add the following registry value:
Value Name: DisableDHCPMediaSense
Data Type: DWORD
Value Data Range: 0, 1 (False, True)
- This parameter controls DHCP Media Sense behavior. If you set this value data to 1, DHCP, and even non-DHCP, clients ignore Media Sense events from the interface. Set this parameter to 1 to cause it to disable.
- Restart your computer
Once the PC comes back up, the setting should have taken place and you should not have to deal with Media Sensing anymore. If you still see it, you may have set the Registry String incorrectly so double check it.
Is there anything else I should know?
Yes, you should be aware that not only is the Media Sensing gone, but also that handy way for your end user community to call your help desk and tell them that the cable is unplugged. They may even see this message and realize they kicked the cable out themselves. For those of you in a work based environment, you may not want to disable this feature for that simple reason alone. I remember from the NT days how many calls can come into a help desk based on end users accidentally unplugging a network cable and that meant ‘the network is down!’ when it was really the fact that it was an unplugged LAN cable.
How to Disable Media Sense for TCP/IP in Windows 2000