用Windows命令行修改IP

 1. 指定IP,DNS

 

netsh interface ip set address "本地连接" static 192.168.1.3 255.255.255.0 192.168.1.1 1  #192.168.1.1为网关
netsh interface ip add dns name="本地连接" addr=221.130.33.60 index=1
netsh interface ip add dns name="本地连接" addr=221.130.33.52 index=2

 

2. 自动获取IP及DNS

 

netsh interface ip set address name="本地连接" source=dhcp
netsh interface ip set dns name="本地连接" source=dhcp register=PRIMARY
echo netsh interface ip set wins name="本地连接" source=dhcp

你可能感兴趣的:(windows,interface)