前言:两个网线,一个内网一个外网,周六摸鱼用外网直接设置DHCP获取。需要切换到内网时候为静态IP,写2个bat文件切换网线后点击直接切换

设置指定IP地址 子网掩码 网关 和DNS

netsh interface ip set address "本地连接" static 192.168.20.78 255.255.255.0 192.168.20.100

netsh interface ip set dns "本地连接" static 8.8.8.8 primary

netsh interface ip add dns "本地连接" 144.144.144.144

设置ip 网关 和DNS为DHCP自动

netsh interface ip set address name="本地连接" source=dhcp

netsh interface ip set dns name="本地连接" source=dhcp

复制到文本文档 保存为bat后缀的批处理文件

最后修改:2022 年 05 月 29 日
如果觉得我的文章对你有用,请随意赞赏