切换IP地址

   经常到各家医院出差,经常要配不同局域网的地址,另外许多医院的因特网和局域网是物理隔离的,为了上网必须不停切换IP地址。

一种简单的方法是使用netsh命令,把不同地址配置编写为批处理文件,例如:

netsh interface ip set address name=本地连接 source=static addr=192.168.100.199 mask=255.255.255.0

 

http://www.cnblogs.com/LeeWenjie/archive/2006/11/24/570775.html

有一篇IP切换的批处理文件:

@echo off

echo ******************************************************************

echo ** 自动IP修改器:IPChange                                        **

echo ** LeeWenjie 2006-11-26                                         **

echo ******************************************************************

echo ** 选项说明                                                     **

echo ** [F]: Family  自动获承IP                                      **

echo ** [5]: Office5 网关192.168.22.5                                **

echo ** [2]: Office2 网关192.168.22.2                                **

echo ** [P]: Pantry  厦航网关                                        **

echo ** [C}: Cancel  取消操作                                        **

echo ******************************************************************

echo ** 请选择:                                                      **

 

choice /c f52pc /m [Family,Office5,Office2,Pantry,Cancel] /D 2 /T 10

 

if errorlevel 5 goto end

if errorlevel 4 goto pantry

if errorlevel 3 goto office2

if errorlevel 2 goto office5

if errorlevel 1 goto family

 

:family

echo Set Family's IP Start......

netsh interface ip reset log.txt

netsh interface set interface 本地连接 disable

netsh interface ip set address name=本地连接 source=dhcp

netsh interface ip set address name=本地连接 gateway=none

netsh interface set interface 本地连接 enable

del log.txt

echo Set Family's IP End.

goto end

 

:office5

echo Set Office5's IF start......

netsh interface ip reset log.txt

netsh interface ip set address name=本地连接 source=static addr=192.168.22.111 mask=255.255.255.0

netsh interface ip set address name=本地连接 gateway=192.168.22.5 gwmetric=0

netsh interface ip set dns name=本地连接 source=static addr=202.101.103.55 register=PRIMARY

del log.txt

echo Set Office5's IP End.

goto end

 

:office2

echo Set Office2's IP Start......

netsh interface ip reset log.txt

netsh interface ip set address name=本地连接 source=static addr=192.168.22.111 mask=255.255.255.0

netsh interface ip set address name=本地连接 gateway=192.168.22.2 gwmetric=0

netsh interface ip set dns name=本地连接 source=static addr=202.101.103.55 register=PRIMARY

del log.txt

echo Set Office2's IP End.

goto end

 

:pantry

echo Set Pantry's IP Start......

netsh interface ip reset log.txt

netsh interface ip set address name=本地连接 source=static addr=192.168.1.199 mask=255.255.255.0

netsh interface ip set address name=本地连接 gateway=192.168.1.254 gwmetric=0

netsh interface ip set dns name=本地连接 source=static addr=202.101.103.55 register=PRIMARY

del log.txt

echo Set Pantry's IP End.

goto end

 

:end

echo Good Lock

@echo on

 

 

第二种方法使用软件。例如IPCHANGER , IPHELPER

我使用的是IPHELPER  http://www.4w5w.com/soft/ ,因为它是绿色的、免费的、没有限制的。但说实话,它的可用性没有其它商用的好。好在也用习惯了。

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9036/viewspace-693/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9036/viewspace-693/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值