现在的位置: 首页 > 综合 > 正文

网络地址切换批处理文件

2013年04月12日 ⁄ 综合 ⁄ 共 470字 ⁄ 字号 评论关闭

适用于静态IP有特殊用途的情况,比如:NAPT地址映射到某一固定IP的特定端口。

 

从无线网络的静态ip切换到有线网络的静态IP:

@echo off
netsh interface ip set address 无线网络连接 dhcp
netsh interface ip set dns 无线网络连接 dhcp
netsh interface ip set address 本地连接 static 192.168.1.5 255.255.255.0 192.168.1.1 1
netsh interface ip set dns 本地连接 static 192.168.1.1

 

从有线网络的静态IP切换到无限网络的静态IP:

@echo off
netsh interface ip set address 本地连接 dhcp
netsh interface ip set dns 本地连接 dhcp
netsh interface ip set address 无线网络连接 static 192.168.1.5 255.255.255.0 192.168.1.1 1
netsh interface ip set dns 无线网络连接 static 192.168.1.1

抱歉!评论已关闭.