网络安全

位置:IT落伍者 >> 网络安全 >> 浏览文章

两个Windows下自动切换IP小脚本


发布日期:2023年02月22日
 
两个Windows下自动切换IP小脚本

从办公到家庭环境或者从会议室到办公工位上的IP切换相信已经把你搞的烦死了那么用下面的个小脚本吧呵呵药到病除

切换成自动获取IP

@echo off

netsh interface ip set address name=local source=dhcp

netsh interface ip set dns name=local source=dhcp

切换成固定IP

@echo off

netsh interface ip set address local static

netsh interface ip set dns local

netsh interface ip add dns local index=

netsh interface ip add dns local index=

local 是你的本地网卡名称也可能是 本地连接需要自己替换下如果是个固定IP间的来回切换把第个脚本自己改改吧 :)

dns设置中第一个是set表示设置后面两个则是添加自己替换成当地的dns server

上一篇:ADSL路由功能详解及应用技巧

下一篇:利用VLAN实现网络性能优化