IP config with netsh under windows

=================================================

CHINAUNICOME.bat

route delete 0.0.0.0 mask 0.0.0.0 10.125.22.254
REM (删除内网网关)

route change 0.0.0.0 mask 0.0.0.0 111.195.179.64 metric 2
REM (改变默认外网网关优先权为2,111.195.179.64为外网分配的ip地址)

route add 10.0.0.0 mask 255.0.0.0 10.125.22.254 metric 1
REM (添加内网路由点,且优先权设置为1)

 

=================================================

rem MAC 18-A9-05-87-0A-71
ipconfig /all >ipconfig.log
netsh interface ip set address "本地连接" static 10.118.48.84 255.255.255.0 10.118.48.254 1
netsh interface ip set dns "本地连接" static 10.118.1.1 primary
netsh interface ip add dns "本地连接" 10.118.5.1
ipconfig /all

 

=================================================

rem Local Area Connection
ipconfig /all >ipconfig.log
netsh interface ip set address "本地连接" static 10.120.20.251 255.255.255.0 10.120.20.254 1
ipconfig /all

 

=================================================

rem Local Area Connection
ipconfig /all >ipconfig.log
netsh interface ip set address "本地连接" static 10.125.22.170 255.0.0.0 10.125.22.254 1
netsh interface ip set dns "本地连接" static 219.141.136.10 primary
netsh interface ip add dns "本地连接" 8.8.8.8
ipconfig /all

 

=================================================

自动.bat

rem Local Area Connection
ipconfig /all >ipconfig.log
netsh interface ip set address "本地连接" source=dhcp
netsh interface ip set dns "本地连接" source=dhcp
rem ipconfig /all

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值