Dos命令設置固定IP和設置IP自動獲取

# 設置固定IP、子網掩碼、默認網關、DNS

@echo off
netsh interface ip set address "無線網絡連接" static 172.20.10.8 255.255.255.240 172.20.10.1
netsh interface ip set dns "無線網絡連接" static 172.20.10.1
netsh interface ip add dns "無線網絡連接" 8.8.8.8
pause

# 設置IP、子網掩碼、默認網關、DNS自動獲取

@echo off
netsh interface ip set address name="無線網絡連接" source=dhcp
netsh interface ip set dns name="無線網絡連接" source=dhcp
pause

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章