cmd修改ip地址网关命令
时间: 2023-09-18 08:09:23 浏览: 56
To change the IP address and gateway using the command prompt on Windows, you can follow these steps:
1. Open the command prompt by pressing the Windows key + R, typing "cmd" and pressing Enter.
2. Type "ipconfig" to view the current IP address and gateway.
3. Type "netsh interface ipv4 show config" to view the network interface configuration.
4. Note the name of the interface you want to configure (e.g. "Ethernet").
5. Type "netsh interface ipv4 set address name=<interface> static <ip_address> <subnet_mask> <default_gateway>" to set the IP address, subnet mask, and default gateway for the interface. Replace <interface> with the name of the interface, <ip_address> with the desired IP address, <subnet_mask> with the subnet mask, and <default_gateway> with the desired default gateway.
For example, if you want to set the IP address to 192.168.0.10, subnet mask to 255.255.255.0, and default gateway to 192.168.0.1 for the "Ethernet" interface, you can run the following command:
```
netsh interface ipv4 set address name=Ethernet static 192.168.0.10 255.255.255.0 192.168.0.1
```
After running this command, you should see a message indicating that the interface has been configured with the new IP address, subnet mask, and default gateway.