双用户自动切换ip

来源:百度知道 编辑:UC知道 时间:2024/06/15 02:15:44
我现在是用一个网卡手动切换ip的方式上网的,因为单位有内网,想在建一个用户上内网,有什么方法能一点切换用户,就能自动切换IP地址和网关的方法啊?最简单有效的方法。

自动填写双击后自动更改为所需IP
把下面文字复制到文本文档里,IP换成你想用的IP,把.txt改为.bat。双击运行!按任意键!

@ echo off
echo This Programe will change your Ipaddress and Gateway.
echo Press any key to continue
pause >nul

rem 设置变量
set Nic=本地连接
rem //可以根据你的需要更改,
set Add=192.168.1.2
rem //可以根据你的需要更改
set Gat=192.168.1.1

netsh interface ip set address name=%Nic% source=static addr=%add% mask=255.255.255.0 %Gat% 1
rem //顺便把DNS也改掉
netsh interface ip set dns name=%Nic% source=static addr=201.12.13.14 primary

echo OK!