|
这个是我用的脚本@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 LAN 192.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 LAN 192.168.0.4 2 no
goto 3
:3
exit
|
评分
-
查看全部评分
|