Windows Advisor

TCP/IP Reset

Don't reinstall Windows XP/2003 when you've got a corrupted TCP/IP stack. Use NetShell to get you out of a jam quickly.

In earlier versions of Windows, TCP/IP was a separate optional component that could be added or removed like any other protocol. In Windows XP/2003, TCP/IP can't be removed because now it's a core component of the operating system. Especially on a Windows Server 2003, TCP/IP functionally is critical for network operations and the Active Directory domain environment. The entire Active Directory architecture is based on DNS hierarchy, which relies on TCP/IP.

In some situations, you may encounter a corrupt TCP/IP stack. Although rare, this situation can be disruptive because you can't remove and reinstall TCP/IP anymore. So, what's the solution? Reinstalling the operating system? Well, that's one option.

Another option -- the preferred method -- is to reset TCP/IP to the default state at the time when the OS was installed. You can use the NetShell (netsh.exe) utility to do that.

When you reset TCP/IP, it will rewrite all the important keys in the registry, which has the effect of removing and reinstalling the entire TCP/IP stack.

Tech Help—Just An
E-Mail Away

Got a Windows, Exchange or virtualization question or need troubleshooting help? Or maybe you want a better explanation than provided in the manuals? Describe your dilemma in an e-mail to the MCPmag.com editors at mailto:[email protected]; the best questions get answered in this column and garner the questioner with a nifty MCPmag.com baseball-style cap.

When you send your questions, please include your full first and last name, location, certifications (if any) with your message. (If you prefer to remain anonymous, specify this in your message, but submit the requested information for verification purposes.)

The NetShell utility is a command line tool (netsh.exe) that allows you to monitor and configure networking components on Windows XP/2003. To run this tool, go to the command prompt and type netsh. To display a list of commands that are available, type help, or simply type a question mark "?".

C:\>netsh
netsh>?

The following commands are available:

Commands in this context:
.. - Goes up one context level.
? - Displays a list of commands.
abort - Discards changes made while in offline mode.
add - Adds a configuration entry to a list of entries.
alias - Adds an alias.
bridge - Changes to the `netsh bridge' context.
bye - Exits the program.
commit - Commits changes made while in offline mode.
delete - Deletes a configuration entry from a list of entries.
diag - Changes to the `netsh diag' context.
dump - Displays a configuration script.
exec - Runs a script file.
exit - Exits the program.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
interface - Changes to the `netsh interface' context.
offline - Sets the current mode to offline.
online - Sets the current mode to online.
popd - Pops a context from the stack.
pushd - Pushes current context on stack.
quit - Exits the program.
ras - Changes to the `netsh ras' context.
routing - Changes to the `netsh routing' context.
set - Updates configuration settings.
show - Displays information.
unalias - Deletes an alias.
winsock - Changes to the `netsh winsock' context.

The following sub-contexts are available:
bridge diag firewall interface ras routing winsock

To view help for a command, type the command, followed by a space, and then type ?.

Tip: You can use abbreviations, or just the beginning part of a command instead of typing the entire command. For example, you can type int for interface, h for help, and either q or b to exit the program. If you want to go one level up in the path, type ".." without the quotes. You can also type the entire command without going into the individual contexts of netsh.

To reset TCP/IP, type the following at the command prompt:

netsh interface ip reset logfile_name

where logfile_name is the name of a log file in the current directory, e.g. resetlog.txt. You can also create a log file in a different folder if you provide the full path.

When you reset TCP/IP, the two areas of registry that are affected include:

  • SYSTEM\CurrentControlSet\Services\DHCP\Parameters\
  • SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\

For a sample Windows XP TCP/IP reset log, check out resetlog.txt on my Web site. If you notice that your log is empty, it could be because the TCP/IP entries on your computer have not been changed since the default installation.

About the Author

Zubair Alexander, MCSE, MCT, MCSA and Microsoft MVP is the founder of SeattlePro Enterprises, an IT training and consulting business. His experience covers a wide range of spectrum: trainer, consultant, systems administrator, security architect, network engineer, author, technical editor, college instructor and public speaker. Zubair holds more than 25 technical certifications and Bachelor of Science degrees in Aeronautics & Astronautics Engineering, Mathematics and Computer Information Systems. His Web site, www.techgalaxy.net, is dedicated to technical resources for IT professionals. Zubair may be reached at [email protected].

comments powered by Disqus
Most   Popular