经常更换多个IP地址如何使用脚本一健更换
现在经常更换多个IP地址,要如何使用脚本一健更换,有三、四个IP地址,求大神们帮忙弄下,例如运行时输入1,一个IP地址,输入2又是另一个IP地址,输入3.......等,能一键更换的。将使用脚本发上来 很多这样的IP切换工具的,搜索一下就有... 本帖最后由 l3429900 于 2024-4-25 11:12 编辑
可以在ip设置了添加多个ip,就可以不用切换ip而自适应了,微软功能就有 以太网-属性-ip4-高级-ip设置-添加 这个是我用的脚本@echo off
echo 1 设置单IP
echo 2 设置多IP
echo 3 退出
choice /c 123 /n /m "请选择【1-3】":
if %errorlevel% equ 1 goto 1
if %errorlevel% equ 2 goto 2
if %errorlevel% equ 3 goto 3
:1
@echo 恢复DHCP
netsh interface ip set address LAN dhcp
netsh interface ip set dnsserver LAN dhcp
@echo 设置IP
netsh interface ip set address LAN static 192.168.198.198 255.255.255.0 192.168.198.1 1
@echo 设置DNS
netsh interface ip set dnsserver LAN static 192.168.0.8 primary no
netsh interface ipv4 add dnsserver LAN192.168.0.4 2 no
goto 3
:2
@echo 恢复DHCP
netsh interface ip set address LAN dhcp
netsh interface ip set dnsserver LAN dhcp
@echo 设置IP
netsh interface ip set address LAN static 192.168.198.198 255.255.255.0 192.168.198.1 1
netsh interface ipv4 add address LAN 192.168.253.225 255.255.255.0
netsh interface ipv4 add address LAN 192.168.186.3 255.255.255.0
netsh interface ipv4 add address LAN 192.168.2.225 255.255.255.0
netsh interface ipv4 add address LAN 192.168.255.225 255.255.255.0
@echo 设置DNS
netsh interface ip set dnsserver LAN static 192.168.0.8 primary no
netsh interface ipv4 add dnsserver LAN192.168.0.4 2 no
goto 3
:3
exit
可以用工具来安完 感谢分享,感恩天地 感谢分享 感谢分享 可用用来借鉴一下 871127qq 发表于 2024-4-25 14:14
这个是我用的脚本@echo off
echo 1 设置单IP
echo 2 设置多IP
echo 2 设置多IP
一个网卡多个IP?? 感恩天地,感谢大佬 好东西,学习学习 871127qq 发表于 2024-4-25 14:14
这个是我用的脚本@echo off
echo 1 设置单IP
echo 2 设置多IP
感谢分享 bilv 发表于 2024-4-26 07:55
echo 2 设置多IP
一个网卡多个IP??
是的 感谢分享,好东西啊 感谢 谢谢
页:
[1]