方便生活,来个备份手册:Windows切换IP和网关的脚本
netsh interface ip set address "本地连接" source=static addr=192.168.0.125 mask=255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.125 255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.126 255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.127 255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.128 255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.129 255.255.255.0 netsh interface ip set address name="本地连接" gateway=192.168.0.253 gwmetric=1 netsh interface ip add address name="本地连接" gateway=192.168.0.254 gwmetric=2 netsh interface ip set dns name="本地连接" source=static addr=192.168.0.253 netsh interface ip add dns "本地连接" 192.168.0.254 pause
netsh interface ip set address "本地连接" source=static addr=192.168.1.100 mask=255.255.255.0 netsh interface ip set address name="本地连接" gateway=192.168.1.1 gwmetric=1 pause