netsh常用命令


netsh常用命令

0.netsh介紹
netsh(Network Shell)是一個windows系統本身提供的功能強大的網絡配置命令行工具

1.修改IP地址addr和子網掩碼mask
netsh interface ip set address name="本地連接" source=static addr=192.168.0.106 mask=255.255.255.0

2.修改默認網關gateway
netsh interface ip set address name="本地連接" gateway=192.168.0.1 gwmetric=0

3.修改首選(PRIMARY)的DNS
netsh interface ip set dns name="本地連接" source=static addr=202.96.128.66 register=PRIMARY

4.禁用無線網卡
netsh interface set interface wlan0 disabled

5.啟用無線網卡
netsh interface set interface wlan0 enabled

4.開啟轉發
netsh interface portproxy add v4tov4 listenaddress=192.168.1.127 listenport=8089 connectaddress=10.125.8.169 connectport=3306

5.刪除轉發
netsh interface portproxy delete v4tov4 listenaddress=192.168.1.127 listenport=8089

6.顯示所有端口代理
netsh interface portproxy show all

7.判斷一個端口是否開啟
netstat -ano -p tcp | findstr "7778" >nul 2>nul && echo 7778端口已開啟 || echo 7778端口未開啟

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM