netsh interface ip set address 本地连接 static 192.168.1.1 255.255.255.0 192.168.1.1 1
@echo off echo 正在修改IP地址...
netsh interface ip set address name="本地连接" source=static addr=192.168.0.2 mask=255.255.255.0 gateway=192.168.0.1 gwmetric=0
netsh interface ip set dnsservers name="本地连接" source=static addr=10.0.0.1 register=primary
netsh interface ip add dns name="本地连接" addr=10.0.0.2 index=2
一楼正解。 不过一楼前一个192.168.1.1 最好改改,不然与网关同一ip了。