快速切换 网络连接

来源:百度知道 编辑:UC知道 时间:2024/09/24 23:49:25
我现在有2个地址
172.25.68.143 (内) 和 128.0.2.143(可以外网)
怎么样快速切换地址??
我建立了个虚拟连接,分配不同的ip
但是虚拟的那个不能连接网络(禁用 本地连接)

也就是我现在有2套不同的ip,怎么样能快速切换过来?
不需要每次手动更改ip?

建两个批处理文件 名字分别为内.bat 外.bat
将下边的内容复制到文件里 分别将里面的IP改成你对应的IP

@echo off
set str1="本地连接"
set oknum=192.168.120.238
set oknum2=192.168.120.1
set netnum=255.255.255.0
echo 正在执行... %ip%
netsh interface ip set address %str1% static %oknum% %netnum% %oknum2% 1
netsh interface ip set dns %str1% static 202.96.104.15