CMD命令下修改和查看IP地址,DNS,网关

时间:2024-10-21 07:04:32

设置IP,DNS,以及网关

>netsh interface ip set address name="本地连接" source=static addr=192.168.132.5 mask=255.255.255.0
>netsh interface ip set address name="本地连接" gateway=192.168.132.1 gwmetric=0
>netsh interface ip set dns name="本地连接" source=static addr=192.168.132.1 register=PRIMARY
>netsh interface ip set wins name="本地连接" source=static addr=none

查看IP,DNS,以及网关

 

>netsh interface ip show address

 

单独查看IP:

cmd中:ipconfig