1. help帮助指南

2. 常用命令介绍

netsh interface ip show address

netsh interface ip dump

netsh interface ip dump > c:ip.txt

1

2

3

静态配置代码:

netsh interface ip set address name="XXXX" source=static addr=172.16.45.129 mask=255.255.0.0 gateway=172.16.45.254 gwmetric=1

netsh interface ip set dns name="XXXX" source=static addr=202.106.196.115 register=PRIMARY

netsh interface ip add dns name="XXXX" addr=211.99.25.1 index=2

1

2

3

其中:name = “XXXX”根据不同的计算机有所不同

Win7 默认 Local Area Connection

其他系统默认 Ethernet

可以通过netsh interface ip show address 确认

自动连接的代码:

netsh interface ip set address name="Ethernet" source=dhcp

netsh interface ip set address name="Ethernet" source=dhcp register=PRIMARY

netsh interface ip set dns name="Ethernet" source=dhcp

---------------------

作者:Alice__Time

版权声明:本文为博主原创文章,转载请附上博文链接!