Using the netsh.exe command to configure TCP/IP

  
Do you know what netsh.exe can do for you? If you don't know, please go down with me. First, it can display the relevant settings for your TCP/IP protocol. Enter the following command in the command prompt window (CMD.EXE): netsh interface ip show config You can also use it to change the computer's IP address or configure other related properties of TCP/IP. For example, you want to specify a static IP address for the computer's "local connection": 192.168.0.100, set its subnet mask to 55.255.255.0, and specify the default gateway to 192.168.0.1, you only need to prompt at the command Enter the following command in the window: netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1 (Note: This is a complete command, please do not wrap when entering. If you have a laptop and you need to access the network in more than two different places (and each network needs to use a static IP address), then you can also use netsh.exe to quickly switch TCP/IP settings. To adapt to the needs of different networks. Ntesh.exe can export different TCP/IP settings to different configuration files, and then import configuration files to change the corresponding settings when needed. For example, your laptop is now connected to Network 1, and the appropriate network settings have been made. At this point you can type in the command prompt: netsh -c interface dump > c:location1.txt Use this command to export the corresponding TCP/IP settings to a text file named c1.txt under the file name. By analogy, you can export the settings of different network environments to different configuration files. When you need to access different networks, you only need to use the following command: netsh -fc:location1.txt (or: netsh -fc:location2.txt) In addition, you can also use netsh .exe to configure the network adapter to get the IP address automatically from the DHCP server. The command is as follows: netsh interface ip set address "Local Area Connection" dhcp can also be configured for WINS: netsh interface ip set wins "Local Area Connection" static 192.168.0.200 Of course, as long as you want, you can also make it through netsh.exe The network adapter dynamically obtains the DNS settings: netsh interface ip set dns "Local Area Connection" dhcp Now you know, netsh.exe is a useful tool for custom TCP/IP settings.
Copyright © Windows knowledge All Rights Reserved