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

上一篇:MySQL数据库数据信息迁移


下一篇:Oracle.EntityFrameworkCore使用时报错:ORA-00933:SQL命令未正确结束