windows 2003 在CMD命令行下设置网卡IP

netsh interface ip set address name="本地连接" source=dhcp
 
netsh interface ip set address name="本地连接" source=static addr=192.168.1.118
mask=255.255.255.0 gateway=192.168.1.1

netsh interface ip  set dns name="本地连接" source=dhcp
 
netsh interface ip set dns name="本地连接" static 202.102.224.68
 
 
netsh interface set interface name="本地连接" admin=disable
 
netsh interface set interface name="本地连接" admin=enable
--------------------
 
 
netsh interface ip>dump

# ----------------------------------
# 接口 IP 配置
# ----------------------------------
pushd interface ip

# "本地连接 2" 的接口 IP  配置
set address name="本地连接 2" source=static addr=xxx.xxx.xxx.xx mask=255.255.255
.248
set address name="本地连接 2" gateway=xxx.xxx.xxx.xx gwmetric=0
set dns name="本地连接 2" source=static addr=xxx.xxx.xxx.08 register=PRIMARY
add dns name="本地连接 2" addr=202.102.224.68 index=2
set wins name="本地连接 2" source=static addr=none
# "本地连接" 的接口 IP  配置
set address name="本地连接" source=static addr=192.168.1.118 mask=255.255.255.0
set dns name="本地连接" source=static addr=202.102.227.68 register=PRIMARY
set wins name="本地连接" source=static addr=none

popd
# 接口 IP 配置结束

----

C:\Documents and Settings\Administrator>netsh -c interface dump >d:\ip.txt
 
C:\Documents and Settings\Administrator>netsh -f d:\ip.txt

你可能感兴趣的:(职场,休闲,cmd 网卡  ip )