Wednesday, April 30, 2008

Some useful "Netsh" Command & Firewall Setup

The graphical user interface
One way to simplify diagnostic tasks is to use the Help Center interface that can be invoked by entering
netsh diag gui
The "netsh interface ip" context
It provides a way to add, delete, modify, and display various IP addresses and TCP/IP settings.
netsh interface ip show config
(set address:- Configures an IP address and a default gateway on a specified interface)
netsh int ip show config
( show address:- Displays address for specified interface)
Reset Internet Protocol (TCP/IP)
Another example of using the Netsh Internet Ip context is resetting TCP/IP. For several reasons, including infestation from spyware, these settings might get corrupted. Netsh contains a command that will reset the TCP/IP stack to the original settings that existed when the operating system was installed. These settings may not be the most up-to-date for your system but they will allow you to reconfigure after a spyware invasion or other problem. The command to reset TCP/IP is
netsh int ip reset {logfile}
Note that you must include the name of a file where a log of the actions will be placed. Thus, if the log file is C:\tcplog.txt, the command is
netsh int ip reset C:\tcplog.txt
The "netsh winsock" context
Service pack 2 for Windows XP includes some additions to the Netsh suite. These are discussed here and include a new tool for repairing the Windows network socket or "winsock". Uninstalling spyware or poorly written applications can corrupt the winsock settings and result in loss of network connectivity. There are two commands for managing the settings. To display a list of various installed services (LSP, BSP, NSP) use
netsh winsock show catalog
This list may not be too meaningful for the average PC user but it can be helpful for more experienced users. To reset the winsock to the default configuration use
netsh winsock reset catalog
Note that any installed software that uses Internet connections may be partially disabled by this action and have to be reinstalled. This would include most software that updates itself and anti-virus programs that use proxy servers. Therefore, this command should only be used for cases where the degree of corruption makes it necessary. See this reference for some alternative methods.
Netsh Firewall Helper in Windows XP SP2
netsh firewall set
and
netsh firewall show

Troubleshooting Windows Firewall settings in Windows XP Service Pack 2 for advanced users

http://support.microsoft.com/default.aspx?kbid=875357

No comments: