Windows 7 預設關閉 ICMP 回顯 (Ping) 以減少攻擊面,但在安全的區域網環境中,Ping 是網管排查連通性的必備工具。本文提供圖形介面 (GUI) 與命令列 (netsh) 兩種開啟方式,並說明 IPv6 對應設定。
netsh firewall set icmpsetting 8 enable
netsh firewall set icmpsetting 8 disable
netsh firewall show state
netsh firewall set opmode enable netsh firewall set opmode disable
若需同時開啟檔案共享,可一次性放行以下埠口:
netsh firewall add portopening UDP 137 "NetBIOS-NS" netsh firewall add portopening UDP 138 "NetBIOS-DGM" netsh firewall add portopening TCP 139 "NetBIOS-SSN" netsh firewall add portopening TCP 445 "SMB-DS"
在同區域網另一台電腦 (或虛擬機) 執行:
ping Win7主機IP # 應收到 Reply from ... bytes=32 time=1ms TTL=128