測試環境 Windows 10 (虛擬機)
想從 MAC 系統確認一下 Windows 10 (虛擬機) 是不是在,結果都 ping 不到.
Ben@Ben10 ~ % ping 192.168.111.36 PING 192.168.111.36 (192.168.111.36): 56 data bytes Request timeout for icmp_seq 0 Request timeout for icmp_seq 1 Request timeout for icmp_seq 2 ^C --- 192.168.111.36 ping statistics --- 4 packets transmitted, 0 packets received, 100.0% packet loss
原來 Windows 預設防火牆把 ping (ICMP) 關掉了,可以用以下兩種方式來開啟.
PowerShell
使用 Administrator 開啟 Windows PowerShell (admin) 來執行.
IPv4
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol="icmpv4:8,any" dir=in action=allow
IPv6
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol="icmpv6:8,any" dir=in action=allow
防火牆與網路保護
或是開啟 防火牆與網路保護 Firewall / 進階設定 .
往下拉到 檔案及印表機共用 (回應要求 ICMPv4-IN) , 如果所有網路都要可以 ping 在 設定檔 就選擇 網域.
按右鍵 啟用規則 (我剛剛已經用指令開啟了,所以我這邊會看到停用規則)
再 ping 試試看.
Ben@Ben10 ~ % ping 192.168.111.36 PING 192.168.111.36 (192.168.111.36): 56 data bytes 64 bytes from 192.168.111.36: icmp_seq=0 ttl=128 time=0.932 ms 64 bytes from 192.168.111.36: icmp_seq=1 ttl=128 time=0.748 ms ^C --- 192.168.111.36 ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.748/0.840/0.932/0.092 ms
沒有解決問題,試試搜尋本站其他內容