Win10 可通過原生 netsh 命令配置靜態 IP,無需第三方工具。適合服務器、網絡設備管理、開發調試等固定地址場景。
cmd (建議管理員權限)netsh interface ipv4 show confignetsh interface ipv4 set address name="乙太網" static 192.168.1.100 255.255.255.0 192.168.1.1netsh interface ipv4 set dns name="乙太網" static 114.114.114.114 primarynetsh interface ipv4 add dns name="乙太網" 8.8.8.8 index=2ipconfig /all 或 netsh interface ipv4 show config "乙太網"
| 場景 | 建議 | 理由 |
|---|---|---|
| 家庭/辦公客戶端 | DHCP | 零配置、避免 IP 衝突、移動便攜 |
| 服務器/NAS/打印機 | 靜態 IP | 固定訪問地址、端口映射、服務發現 |
| 開發/測試環境 | 靜態 IP | 便於配置 hosts、容器網絡、集群通信 |
| 路由器/網關設備 | 靜態 IP | 網絡拓撲核心節點、不可變 |
name="介面名稱"靜態 IP 配置持久化寫入註冊表,重啟保持不變。若需恢復 DHCP:netsh interface ipv4 set address name="乙太網" source=dhcp