Windows下自动切换IP脚本
来源:互联网 发布:杜兰特生涯数据 编辑:程序博客网 时间:2024/05/22 09:01
在不同环境使用电脑经常要切换IP,利用netsh interface ip命令可以轻松切换IP和DNS:
netsh interface ip有以下命令:
add - 在一个表格中添加一个配置项。
delete - 从一个表格中删除一个配置项。
dump - 显示一个配置脚本。
help - 显示命令列表。
install - 安装 IP 协议。
reset - 重置 IP 配置。
set - 设置配置信息。
show - 显示信息。
uninstall - 卸载 IP 协议。
netsh interface IP set有以下的命令:
set address - 设定通向接口的 IP 地址或默认网关。
set compartment - 修改分段配置参数。
set dnsservers - 设置 DNS 服务器模式和地址。
set dynamicportrange - 修更改态端口分配所使用端口的范围。
set global - 修改全局配置常规参数。
set interface - 修改 IP 的接口配置参数。
set neighbors - 设置邻居地址。
set route - 修改路由参数。
set subinterface - 修改子接口配置参数。
set winsservers - 设置 WINS 服务器模式和地址。
简单示例1:设置固定IP,保存为bat文件
@echo off
@rem 设置IP为192.168.0.1,子网掩码为255.255.255.0,默认网关为192.168.0.254
netsh interface ip set address local static 192.168.0.1 255.255.255.0 192.168.0.254
@rem 设置首选的DNS服务器192.168.0.254
netsh interface ip set dns local 192.168.0.254
@rem 添加DNS服务器202.106.196.115
netsh interface ip add dns local 202.106.196.115 index=2
示例2:自动获取
@echo off netsh interface ip set address name="local" source=dhcp netsh interface ip set dns name="local" source=dhcp
- Windows下自动切换IP脚本
- XP下 使用脚本,自动切换IP
- win10下自动切换ip脚本
- windows bat脚本切换ip
- Windows 下 自动 设置IP 的 批处理脚本
- 自动切换IP设置的脚本
- 脚本切换windows IP 和 IE 代理
- Windows 7 快速切换IP的脚本
- windows下以及Linux下经常切换ip的批处理脚本
- Windows系统自动切换IP批处理
- python 脚本自动切换windows代理设置
- 不同网络环境下快速切换IP脚本(Windows版)
- windows下自动ftp脚本
- windowsXP系统下如何自动切换IP
- windows自动配置ip的脚本
- windows下设置ip的脚本
- 切换 IP/DNS 脚本
- ip切换脚本
- SQL逻辑查询处理顺序
- Use Haskell ByteString to Read/Write File
- BI介绍(1)
- 【转】海量查询的数据优化
- 自我规划
- Windows下自动切换IP脚本
- Objective-C 2.0 笔记 (3) Objective-C 物件导向程式设计,类目、协定、继承及复合
- 程序员创业生死一线
- 10款动感图片展示js代码
- log4cplus vs2005配置
- VS2008 如何添加H文件目录和LIB目录
- 史上最全的约瑟夫环算法程序和原理
- New Life
- 我为什么会力争留下他