netsh用法


netsh(Network Shell) 是一个windows系统本身提供的功能强大的网络配置命令行工具。 导出配置脚本:netsh -c interface ip dump > c:\interface.txt 导入配置脚本:netsh -f c:\interface.txt。

1.disable、enable网卡

建议将系统的网卡名改成英文名,这样在输入命令的时候会很方便。

例如:

第一块无线网卡可取名为 wlan0

第一块有线网卡可取名为 eth0,依此类推。

我电脑中的网卡命名如下图所示:

首先以管理员身份身份运行 cmd 程序

禁用无线网卡:netsh interface set interface wlan0 disabled

启用无线网卡:netsh interface set interface wlan0 enabled

禁用有线网卡:netsh interface set interface eth0 disabled

启用有线网卡:netsh interface set interface eth0 enabled

2.更改IP相关

2.1、修改IP地址addr和子网掩码mask:

    >netsh interface ip set address name="本地连接" source=static addr=192.168.0.106 mask=255.255.255.0

2.2、修改默认网关gateway

    >netsh interface ip set address name="本地连接" gateway=192.168.0.1 gwmetric=0

2.3、修改首选(PRIMARY)的DNS

    >netsh interface ip set dns name="本地连接" source=static addr=202.96.128.66 register=PRIMARY 

3.连接无线网络

http://www.360doc.com/content/13/0215/15/6764271_265756941.shtml


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM