Windows 8 可透過圖形介面設定 IP,但命令列 netsh 更快速、適合腳本自動化。本文教學使用 netsh interface ip set address 設定靜態 IP、子網路遮罩、閘道、DNS。
netsh interface ip set address "介面名稱" static IP位址 子網路遮罩 閘道 1
參數說明: 介面名稱參考「網路連線」顯示名稱(支援中文,需用英文雙引號),各參數以空格分隔,結尾 1 代表確認。
netsh interface ip set address "乙太網路 3" static 192.168.1.108 255.255.255.0 192.168.0.1 1
netsh interface ip set address "乙太網路 3" static 192.168.1.108 255.255.255.0 192.168.0.1 1
netsh interface ip set dns "乙太網路 3" static 8.8.8.8
netsh interface ip set address "乙太網路 3" dhcp
netsh interface ip set dns "乙太網路 3" dhcp
或使用網路疑難排解自動修復恢復動態 IP。命令列配置 IP 讓您體驗工程師般的高效操作感。