10. Show TCP/IP settings:
netsh interface ip show config
09. Change network configuration:
Netsh interface ip set address name=”Local Area Connection” source=static addr=192.168.0.10 mask=255.255.255.0 gateway=192.168.0.1 gwmetric=1
08. Use a dynamic DHCP assigned address:
Netsh interface ip set address name=”Local Area Connection” source=dhcp
07. Change a DNS server address:
Netsh interface ip set dns name=”Local Area Connection” source=static addr=192.168.0.2 register=none
06. Dynamically assign the DNS server address:
netsh interface ip set dns name=”Local Area Connection” source=dhcp
05. Configure a WINS server:
Netsh interface ip set wins name=”Local Area Connection” source=static addr=192.168.100.3
05a. To configure WINS from DHCP:
Netsh interface ip set wins name=”Local Area Connection” source=dhcp
04. Work with other interfaces (DHCP,RAS,IAS) – Dump those settings to a file:
netsh dump dhcp > dhcpcfg.dat
dumps the local DHCP server’s configuration to the dhcpcfg.dat file. You can use this file in conjunction with Netsh to recreate the DHCP server.
03. Work with remote systems – set the current computer to a different system on the network:
netsh set machine remotecomputer
02. Save the current configuration to a file:
netsh dump interface > mycfg.dat
01. Restore network configuration from a file:
netsh exec mycfg.dat
00. To add multiple DNS entries you need to type:
netsh interface ip set dns name=”Wireless Network Connection” source=static addr=192.168.1.200 register=PRIMARY
netsh interface ip add dns name=”Wireless Network Connection” addr=192.168.1.5 index=2
In Windows XP you cannot uninstall TCP/IP but you can reset it by typing:
netsh int ip reset resetlog.txt
netsh int ip reset c:\resetlog.txt
This has the same effect at un-installing it and re-installing TCP/IP. For Windows XP KB299357 and for Windows 2003 KB317518.
Other Cool Commands:
Open Port In Firewall:
netsh firewall add portopening protocol=tcp port=135 name=DCOM_TCP135
Check if the firewall is running:
netsh firewall show state
Untested Commands:
Allow Program in Firewall:
netsh firewall add allowedprogram program=%windir%\system32\wbem\unsecapp.exe name=UNSECAPP
Enable Service:
netsh firewall set service RemoteAdmin enable
Robert Holland -July 03, 2004