以下列出本地网络常用的配置命令行,更多命令描述和用法,请参考微软文档 Network Shell (Netsh) | Microsoft Docs
显示当前网络状态信息
-
netsh interface ip show address
– 显示 IP 地址 -
netsh interface ip show config
– 显示更多详情 -
netsh interface ip show ipaddress
– 显示 IP 地址类型 -
netsh interface ip show ipnet
– 显示网络到媒体项目 -
netsh interface ip show route
– 显示当前路由信息
显示和设置 IP 地址
-
netsh interface ip show interface
– 显示接口信息 -
netsh interface ip set address “ 以太网” dhcp
– 通过 DHCP 设置 IP 地址 -
netsh interface ip set address “ 以太网” static 10.1.2.10 255.255.255.0 10.1.2.254
– 设置以太网 IP 地址
显示和设置 DNS 地址
-
netsh interface ip show dns
– 显示 DNS 地址 -
netsh interface ip set dns “ 以太网” dhcp
– 通过 DHCP 设置 DNS 地址 -
netsh interface ip set dns “ 以太网” static 10.0.12.8
– 设置以太网 DNS 地址,清除原有 DNS 设置 -
netsh interface ip add dns “ 以太网” 114.114.114.114 index=2
– 添加以太网 DNS 地址,index 为自定义排序 -
netsh interface ip add dns “ 以太网” 8.8.8.8 index=3
– 添加以太网 DNS 地址,index 为自定义排序 -
netsh interface ip add dns “ 以太网” 1.1.1.1 index=4
– 添加以太网 DNS 地址,index 为自定义排序 -
netsh interface ip add dns “ 以太网” 223.5.5.5 index=5
– 添加以太网 DNS 地址,index 为自定义排序
0 条评论