Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Win8 如何用指令設定靜態 IP?netsh 命令列快速配置網路

編輯:Win8 系統應用技巧

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

同步設定 DNS

netsh interface ip set dns "乙太網路 3" static 8.8.8.8

恢復 DHCP 自動取得

netsh interface ip set address "乙太網路 3" dhcp
netsh interface ip set dns "乙太網路 3" dhcp

或使用網路疑難排解自動修復恢復動態 IP。命令列配置 IP 讓您體驗工程師般的高效操作感。

Copyright © Windows教程網 All Rights Reserved