irisbay.com
 
周四, 2010-09-09
Newsflash

MIPCfg是个灵活配置和保存IP设置的小工具,帮助你记录在不同工作环境中的IP设置。
当你重新回到一个工作环境中时,能轻松地恢复该环境中的IP设置。本软件适合经常携带笔记本辗转于多个IP设置工作地点的人士,也适合工作地点中需要切换不同的网段进行不同的工作的人士,以及家中和办公室中IP设置不同的人士。

快速灵活地切换笔记本Win2K网络配置 PDF 打印 E-mail
作者:Nick   
2007-09-26 08:00

如果你经常需要在不同的网络环境中使用装有Win2K的笔记本,每次换地方,都要不厌其烦的手工修改网络参数。Netsh命令可以帮助你保存当前网络配置到文件中,在需要的时候可以快速的完全恢复过来。

保存当前网络配置,在命令行输入:

C:\> netsh -c interface dump >  networking.txt

你可以为每一个网络环境生成单独的配置文件。

恢复网络配置:

C:\> netsh -f networking.txt

这样,借助Netsh命令,你就可以快速切换不同的网络配置参数,更加方便的移动办公!

注意win 2000以下不支持netsh

如果通过Windows的网络属性修改Ip/网关,真是太麻烦了。
最近一个项目经常要切换ip,所以我写了两个脚本:
c:\116.bat
netsh interface ip set address "本地连接" static 10.45.128.116 255.255.255.0 10.45.128.254 1

c:\172.bat
netsh interface ip set address "本地连接" static 172.17.9.222 255.255.255.0 172.17.9.51 1

这样就可以设置IP/Mask/GateWay了,netsh命令真方便!

如何加多个dns?

我查了一下,dns可以配置多个,如下:
netsh interface ip add dns name = "本地连接" addr = 202.105.12.226
netsh interface ip add dns name = "本地连接" addr = 61.144.56.100
netsh interface ip add dns name = "本地连接" addr = 202.96.128.68
netsh interface ip add dns name = "本地连接" addr = 202.96.128.86

清空DNS:
netsh interface ip set dns name = "本地连接" static addr = none

使用dhcp自动分配ip:
netsh interface ip set address name="本地连接" source=dhcp

 
Webdesign by Webmedie.dk Webdesign by Webmedie.dk