Popular
Latest Articles
- How to Secure your Cisco Router
- Creating CLI Views on a Cisco Router
- Configuring TACACS+ on a Cisco Router
- How to enable SDM on your router
- Build a Samba Server on Redhat / CentOS
- How to set the Time / Date and Timezone in CentOS
- How to install SSH on Solaris 10 x86
- ESX4 - How do I turn on/off a Virtual Machine from the command line ?
Windows - netsh - Change you IP address via the CLI
Saturday, 17 January 2009 16:38
Netsh.exe is a network administration tool that allows you to configure and monitor Windows-based computers at a command prompt. With the Netsh.exe tool, you can direct the context commands you enter to the appropriate helper, and the helper then carries out the command.
Setting you IP address
Below is the syntax for setting the IP address for your wireless connection and adding to DNS servers. Note you can get the name of your interface from the IP config command.
netsh interface ip set address name="Wireless Network Connection 3" static [ip] [netmask] [gw]
netsh interface ip set dns "Wireless Network Connection 3" static [dns server ip]
netsh interface ip add dns "Wireless Network Connection 3" [dns server ip] index=2
Saving your configuration and importing
To export your configuration
netsh -c interface dump > c:\location1.txt
To import your configuration
netsh -f interface dump > c:\location1.txt
Windows firewall
Below shows the syntax for opening a port, showing your firewall state, and disabling the firewall
netsh firewall set portopening tcp 445 smb enable
netsh firewall show state
netsh firewall set opmode disable
GUI
netsh diag GUI
Diagnostics
Below wiill connect to the default incoming and outgoing mail servers then drop the connection. Easier for customers than trying to telnet to the mail server ports.
netsh diag connect mail
Reset all IP protocol stack configurations on your interface and send the output to a log file.netsh int ipv4 reset resetlog.txt