netsh經常使用命令windows
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端口未開啓