批命令设置IP地址

[复制链接]
查看11 | 回复1 | 2015-10-9 13:41:44 | 显示全部楼层 |阅读模式
@echo off@echo 正在设置IPset eth=本地连接set ip=254goto n1:n1netsh interface ip set address name=%eth% source=static addr=10.10.22.%ip% mask=255.0.0.0 gateway=10.10.22.254 gwmetric=0 >nulif not errorlevel 0 set /a ip-=1 & goto n1netsh interface ip set dns name=%eth% source=static addr=202.117.112.3 register=PRIMARY >nulnetsh interface ip add dns name=%eth% addr=218.30.19.40 index=2 >nulexit把IP 网关 DNS 改为你所需的
回复

使用道具 举报

千问 | 2015-10-9 13:41:44 | 显示全部楼层
用DOS命令设置ip地址及DNS 设置/修改IP地址,子网掩码,网关的格式: netsh interface ip set address "本地连接" static 10.25.35.35 255.255.255.0 10.25.35.7 auto 命令的意思是将“本地连接” ip地址设置成 10.25.35.35 子网掩码是 255.255.255.0 网关设置成 10.25.35.7 并且自动跃点数 注意:"本地连接"处请根据自己的情况修改 设置DNS命令格式: netsh interface ip set dns "本地连接" static 211.138.91.1 命令的意思是将“本地连接”的DNS设置成211.138.91.1 删除IP地址和DNS的命令是 netsh interface ip set address "本地连接" dhcp netsh interface ip set dns "本地连接" dhcp
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行