1. 添加静态IP
--------------------------------------------
netsh interface ip add address name="本地连接" addr=192.168.1.2 mask=255.255.255.0
gateway=192.168.1.1 gwmetric=0
2. 修改静态IP
---------------------------------------------
netsh interface ip set address name="本地连接" source=static addr=132.159.172.182
mask=255.255.255.192 gateway=132.159.172.129 gwmetric=0
(网关与IP混在一起常常设置失败,网关最好单独设置
3. 添加网关
--------------------------------------------
netsh interface ip add address name="本地连接" gateway=192.168.2.1 gwmetric=0
(网关可以加多个,但只有第一个被使用, 除非它出现问题否则永远使用第一个)
4. 设置DHCP
---------------------------------------------
netsh interface ip set address name="本地连接" source=dhcp
5. 显示IP地址
---------------------------------------------
netsh interface ip show address
6. 设置DNS
--------------------------------------------
netsh interface ip set dns name="本地连接" source=static addr=192.168.1.1
7. 添加DNS到列表
--------------------------------------------
add dns name="本地连接" addr=132.159.174.28
附注:
1. 可在dos下键入netsh,查help.
2. "本地连接",是网络连接名称.
3. "gwmetric",是网卡跃点数, 0表示自动计数.