Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

# # CMD modifies ip address

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Under the operating system, we can use the "local connection" attribute to modify IP addresses, but if we want to switch between multiple IP addresses, this method is too cumbersome. We can use NETSH command to add it, which is quite easy. Using DOS to modify IP addresses is as follows:

Use netsh command to add IP address

For example, I want to add an IP to my local connection. An example of netsh is:

netsh int ip add address "Local connection" 192.168.0.100 255.255.255.0

cmd /k netsh interface ip set dns name="local connection" source=static addr=202.103.96.68

1. Change static IP address:

Command: netsh interface ip set address "local connection" static IP mask gateway metric

For example: netsh interface ip set address "local connection" static 192.168.0.10 192.168.0.1 255.255.255.0

2. Change DNS:

Command: netsh iterface ip set dns "local connection" static DNS address pimary

For example: netsh interface ip set dns "local connection" static 202.96.128.143 primary

If your IP needs to switch back and forth between several IPs, you can use the netsh command to modify the IP address.

1. Enter CMD command line;

Click "Start"->"Run", type "cmd", enter,

2. Set IP:

Set Dynamic IP Address Acquisition (DHCP)

c:/>netsh interface ip set address name="local connection" source=dhcp

Set Fixed IP

c:/>netsh interface ip set address name="local connection" source=static addr=192.168.1.2 mask= 255.255.0 gateway=192.168.1.1 gwnetric=auto

Parameter Description:

1. name: network connection name, usually "local connection". You can see it in Control Panel-> Network Connections.

Source: Access to IP. Dynamic acquisition, dhcp, manual setting, static.

3.addr: IP address to be set.

4. mask: subnet mask.

Gateway: Gateway address.

6.gwmetric: Gateway metric number, can be set to integer value, can also be set to "automatic": auto.

3. Set DNS:

Get DNS automatically

c:/>netsh interface ip set address name="local connection" source=dhcp

Set up individual DNS manually

c:/>netsh interface ip set address name="local connection" source=static addr=210.52.149.2 register=primary

Set up multiple DNS manually

c:/>netsh interface ip set address name="local connection" addr=202.106.0.133 index=2

Parameter Description:

1. name: network connection name, usually "local connection". You can see it in Control Panel-> Network Connections.

Source: Access to IP. Dynamic acquisition, dhcp, manual setting, static.

3.addr: IP address to be set.

4.register:

5.none: Disable dynamic DNS registration.

Primary: Register only under the primary DNS suffix.

7.both: Registered under the primary DNS suffix, also registered under the specific connection suffix.

8.index: The DNS sequence number of the setting.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report