Many times, we may need to work on different networks, and repeated changes to the IP address over and over again is a tricky business. In addition, the system crashes, the reconfiguration of the network card and other related parameters are also more annoying (especially wireless network card). In fact, cleverly using the Netsh commands built into the Windows 2000/xp/2003 system, not only can you quickly switch IP addresses, you can switch between static and dynamic IP address settings at any time, but also enable you to back up and restore network settings at any time, and so on.
What is Netsh?
Netsh is a command-line scripting utility provided by the Windows 2000/xp/2003 operating system itself, which allows users to display or modify the network configuration of a computer that is currently running locally or remotely.
Example one: Switching IP addresses anytime, anywhere
Open Notepad, create a new file, and enter the following code in it:
netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1
Then click file → save, save the type set to all files, name the file Home.cmd, and save it on the desktop.
Similarly, create a office.cmd file in which to enter:
netsh interface ip set address "Local Area Connection" static 192.168.1.11 255.255.248.0 192.168.0.1 1
At home. Just double-click Home.cmd to quickly switch IP address to 192.168.0.10, subnet mask: 255.255.255.0, Gateway: 192.168.0.1, and then double-click Office.cmd to the company to 192.168.1.11, Subnet Mask: 255 .255.248.0, Gateways: 192.168.1.1.
Small tip:
1. The IP address assigned by each company is different, we can set it according to our own actual situation.
2. The "Local Area Connection" in the above command is the name of the network card connection, and you can double-click the Network Connections icon in Control Panel to see the name of the appropriate network adapter. If you have more than one network card, just change the name of the "local connection" above and the IP, subnet mask and gateway.
3. The last 1 of the above command is set to the metric, the value is more professional, the user can be set to 1, do not bother.
Example two: fixed/dynamic IP change at any time
First create a static.cmd file on your desktop, and then enter the appropriate code in it, such as:
netsh interface ip set address "Local Area Connection" static 192.168.0.12 255.255.255.0 192.168.0.1 1
At the same time, create a dhcp.cmd file in which you enter the following code:
netsh interface ip set address "Local Area Connection" DHCP
Ipconfig/release
Ipconfig/renew
When you double-click Static.cmd on the desktop later, the IP address of the "Local Area Connection" is modified to 192.168.0.12, Subnet mask: 255.255.255.0, Gateway: 192.168.0.1. When you double-click the Dhcp.cmd file, the local area connection is immediately set to dynamic IP and immediately obtains the latest IP address from the DHCP server.
Example three: Backup/restore network settings
In addition, Netsh can also back up the current network state, press the WIN+R key combination, enter the cmd command to return, at the command prompt, enter the following code:
Netsh dump >d:/netbck.txt
This will back up the current network settings to the D:/netbck.txt file, which is a text file that includes the setup information for all network cards in the current system, and saves it. Later, the machine crashes or needs to reinstall the system, you can use Backup to quickly restore network settings, just under command prompt, enter netsh exec d:/netbck.txt
Can.
The netsh command is indeed a very good tool, simple, easy, and fast, and can quickly manage/backup/restore your network without other software assistance (many similar software is chargeable).
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Network/wgzs/