Netsh命令-修改網絡IP設置

原文連接地址:https://blog.csdn.net/qq_38054198/article/details/77990914spa

靜態設置IP.net

  •    修改IP地址addr和子網掩碼mask:

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

  •     修改默認網關gateway

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

  •     修改首選(PRIMARY)的DNS

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

  • 導出、導入配置文件

  \>netsh -c interface ip dump >c:interface.txtip

  \>netsh -f c:interface.txt配置

 

固然,name=、source=、addr=、mask=、gateway=、gwmetric= 能夠省略,寫成以下形式(必須按照順序)qq

netsh interface ip>set address "本地鏈接" static 211.67.17.120 255.255.255.0 211配置文件


動態設置IPstatic

  \>netsh interface ip>set address name="本地鏈接" source=dhcp

刪除IP配置信息(delete address)

 

  \>netsh interface ip>delete address name="本地鏈接"  addr=192.168.0.111

相關文章
相關標籤/搜索