How does the Windows system use the command prompt to configure the IP address?

  

Modify the IP address can be implemented in the system's own "Network and Sharing Center". However, many users sometimes need to set a static IP to be able to achieve normal network communication. At this time, only through the "universal" command line to solve the problem.

1, use the shortcut key "Win+R" to open the running interface, enter "cmd" enter, open the command prompt.

2, in the command prompt, type "netsh"--->"interface"--->"ip", and then press Enter.

3. Enter [set address "connection name" static new IP address subnet mask gateway 1], then press Enter. Note that the above commands need to be modified according to user requirements. The connection name can be modified by referring to the name in “Network Connection”, which supports Chinese, but the quotation mark should be in English. There must be a space between each item, and finally enter "ldquo;1", which means OK. Refer to the following example: set address "Ethernet 5" static 192.168.1.6 255.255.255.0 192.168.0.1 1

4, you can also enter the above command once, but make sure not to wrap: [netsh interface Ip set address "connection name" static new IP address subnet mask gateway 1]

Example: netsh interface ip set address "Ethernet 3" static 192.168.1.108 255.255.255.0 192.168.0.1 1

5. It should be noted that the system IP becomes static after modification. If it does not meet the user's needs, you can use the system's own network "troubleshooting" to automatically repair and restore the dynamic IP. Of course, you can also restore the IP address by the following command:

[netsh interface ip set address "connection name" dhcp]

6, you can also use similar commands to modify the DNS, format Same as above, just replace “address” with “dns”:

[netsh interface ip set dns "Ethernet 3" static DNS address]

[netsh interface Ip set dns "connection name" dhcp】

Copyright © Windows knowledge All Rights Reserved