Netsh commands have been known for a long time, allowing configuration changes in the internal or remote network through Netsh commands in Windows 2000, XP, Windows Server 2003, Windows Server 2008, or Windows Vista. Today, we delve deeper into Windows Server 2008 Netsh commands. Each administrator may have different commonly used Netsh commands, but today Mytour introduces 10 commonly used commands to help you address issues or troubleshoot.
Top 10 essential Netsh commands for Windows Server 2008
1. Configure network interface settings and IP addresses
Netsh is a 'network shell,' and the best way to use it is to configure basic network settings. For example:
Show IP address - netsh interface ip show config
Set the interface to use DHCP for its IP address configuration - netsh interface ip set address name='Local Area Connection' source=dhcp
Set the interface to use a static IP address for its IP configuration - netsh interface ip set address 'Local Area Connection' static 10.0.0.9 255.0.0.0 10.0.0.1 1
Add DNS Server entry - netsh interface ip add dnsserver 'Local Area Connection' 10.0.0.1
2. Configure wireless settings
Netsh command to connect to a predefined wireless network - netsh wlan connect ssid='mySSID' name='WLAN-Profile1'
Show current wireless settings - netsh wlan show settings
Add an additional wireless network profile that has been exported - netsh wlan add profile filename='Wireless Network Connection-BOW.xml'
3. Configure Windows Firewall
Netsh command to display all rules of the firewall - netsh advfirewall firewall show rule name=all
Delete firewall rule for incoming traffic on port 21 - netsh advfirewall firewall delete rule name=all protocol=tcp localport=21
Export Windows Advanced Firewall settings - netsh advfirewall export 'c:advfirewall.wfw'Perhaps the most commonly used command is to enable or disable the Windows firewall, like so:
netsh firewall set opmode disable
or
4. Troubleshoot TCP/IP issues and reset interfaces
Netsh command to reset all IP protocol stack configurations on your interface and send output to a log file - netsh int ipv4 reset resetlog.txt
Install TCP/IP protocol - netsh int ipv4 install
Uninstall TCP/IP protocol - netsh int ipv4 uninstall
5. Explore the capabilities of the new Netsh utility
New categories appearing in my Windows Server 2008 system:
dhcp
dhcpclient
http
ipsec
lan
nap
netio
rpc
winhttp
6. Export current network configuration to a file and import
Simply enter the Netsh command as follows:
netsh -c interface dump > test.txt
On another computer, you can import this configuration with netsh -f test.txt
7. Open ports on the firewall
For example, to open port 445, you enter the Netsh command as follows:
netsh firewall set portopening tcp 445 smb enable
Upon successful execution, you will receive an 'Ok' message.
8. Run Netsh in interactive mode or with a script
netsh>
All desired netsh commands can be entered here, including commands to connect netsh to a remote control computer. Alternatively, you can use netsh -f
9. Provide names and credentials for remote control computers
Use Netsh command: netsh -r WinXP-1 -u winxp-1administrator -p My!Pass1 interface ip show config
10. Seek Assistance
The command '/?' displays Nesh's help options in Windows. Use this command to get guidance on what you want to accomplish. For example, type the Netsh command: netsh /?
The help options for the '/?' command are presented on the screen
From here, you can choose a context and be guided through configuration or displaying options within that context. For instance, type the Netsh command: netsh lan /?, and you will see:
- Execute 'netsh lan /?' to display the results
- We can proceed with assistance using
- 'netsh lan show /?.'
- We'll encounter an interface with
- 'netsh lan show interfaces'
Guiding yourself through various netsh commands using /? is a highly valuable skill.
Here are just 10 commonly used Netsh commands for Windows Server 2008 that you should know. There are many more Netsh commands that we will introduce in the next article. Through this, you can see the flexibility and power in using Netsh commands for administrators. Readers should also check out articles on CMD commands, common commands in cmd win 7, 8 to enhance knowledge of everyday commands.