设置自动获取IP以及自动获取DNS命令:
netsh interface ip set address name="本地连接" source=dhcp
netsh interface ip set dns name="本地连接" source=dhcp
win7/server 2008 r2 命令行配置本地连接:
netsh interface ip set address name="本地连接" source=static addr=192.168.1.99 mask=255.255.255.0 gateway=192.168.1.230
netsh interface ip set dns "本地连接" source=static addr=202.120.190.208
主dns地址
netsh interface ip set dns name="本地连接" source=static addr=218.85.157.99 register=PRIMARY
备dns地址
netsh interface ip add dns name="本地连接" addr=218.85.152.99
xp命令行配置本地连接:
netsh interface ip set address name="本地连接" source=static addr=192.168.1.99 mask=255.255.255.0
netsh interface ip set address name="本地连接" gateway=192.168.1.230 gwmetric=0
netsh interface ip set dns "本地连接" source=static addr=218.85.157.99