Allow ping (ICMP echo) through the Windows firewall

Create an inbound firewall rule for ICMPv4 echo requests so the PC answers ping.

WindowspingnetworkfirewallMedium risk
Run `netsh advfirewall firewall add rule name="Allow ICMPv4 Ping" protocol=icmpv4:8,any dir=in action=allow` as administrator to let the PC answer pings.

01Command

Command
$ netsh advfirewall firewall add rule name="Allow ICMPv4 Ping" protocol=icmpv4:8,any dir=in action=allow

02What it does

Windows Firewall silently drops incoming ICMP echo requests, so other machines see the PC as offline even though it works fine. This netsh rule allows inbound ICMPv4 type 8 (echo request) on all profiles. To allow only on private networks, add `profile=private` to the command; for IPv6 pings, create the same rule with protocol=icmpv6:8,any.

03Risk

RiskMedium risk
RequirementsAdministrator terminal required.
!Warning: Answering pings reveals your machine on the network. On a public Wi-Fi, prefer `profile=private` or delete the rule when done.

04Undo

Undo
$ netsh advfirewall firewall delete rule name="Allow ICMPv4 Ping"

05Sources

  • New-NetFirewallRule
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Creates an inbound firewall rule; can be scoped to the ICMPv4 protocol to allow echo requests.
  • netsh
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Documents netsh WLAN commands including `netsh wlan show profile name=... key=clear` and `netsh wlan delete profile name=...`.

Last verified: 2026-09-18 · Category: Network

06Related solutions