有些公司加入域后影响一些正常的上网行为,这个时候需要设置静态IP,下面一个批处理文件
可以自动设置ip
@ECHO off
netsh interface ip set address name="本地连接" source=static addr=10.16.252.77 mask=255.255.252.0
echo 第一个ip设置成功
pause
netsh interface ip add address name="本地连接" addr=172.16.0.247 mask=255.255.255.0
echo IP和子网掩码设置完成
netsh interface ip set address name="本地连接" gateway=10.16.252.1 gwmetric=0
echo 网关设置完成........
netsh interface ip set dns name="本地连接" source=static addr=218.85.152.99 register=PRIMARY
echo DNS1设置完成........
netsh interface ip set wins name="本地连接" source=static addr=none
pause
rem netsh interface ip set address name="本地连接" source=dhcp
rem netsh interface ip set dns name="本地连接" source=dhcp
可以自动设置ip
@ECHO off
netsh interface ip set address name="本地连接" source=static addr=10.16.252.77 mask=255.255.252.0
echo 第一个ip设置成功
pause
netsh interface ip add address name="本地连接" addr=172.16.0.247 mask=255.255.255.0
echo IP和子网掩码设置完成
netsh interface ip set address name="本地连接" gateway=10.16.252.1 gwmetric=0
echo 网关设置完成........
netsh interface ip set dns name="本地连接" source=static addr=218.85.152.99 register=PRIMARY
echo DNS1设置完成........
netsh interface ip set wins name="本地连接" source=static addr=none
pause
rem netsh interface ip set address name="本地连接" source=dhcp
rem netsh interface ip set dns name="本地连接" source=dhcp