Skip to main content
To allow ping through Windows Firewall, open PowerShell as Administrator and run Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)". Do the same with ICMPv6-In for IPv6. This works on Windows Server 2019, 2022 and 2025 and on Windows 10 and 11. Test it with ping 203.0.113.10 from another computer: you should get Reply from lines.

Before you start

  • Sign in as an administrator, for example over Remote Desktop.
  • Open PowerShell as Administrator: right-click Start and choose Terminal (Admin) or Windows PowerShell (Admin). The netsh commands also work in an elevated Command Prompt.
  • Ping uses ICMP (Internet Control Message Protocol). A ping is an ICMP Echo Request (type 8 for IPv4, type 128 for IPv6). Windows only replies when an inbound firewall rule allows it.

How to allow ping with PowerShell

Windows ships with ready-made Echo Request rules that are usually turned off. Turning them on is the cleanest method, because you don’t create duplicate rules.
1

Find the built-in Echo Request rules

You should see File and Printer Sharing (Echo Request - ICMPv4-In) and File and Printer Sharing (Echo Request - ICMPv6-In). Some Windows releases also list Core Networking Diagnostics - ICMP Echo Request (ICMPv4-In).
2

Enable the IPv4 rule

3

Enable the IPv6 rule (if you use IPv6)

There can be more than one rule with the same name (one per network profile). The command enables all of them, which is what you want on a server.
Never run Enable-NetFirewallRule without a name or group. Microsoft warns that running it without parameters enables every firewall rule on the computer.

Create your own ping rule instead

If the built-in rules are missing or you want a rule you can find easily later, create one:

How to allow ping with netsh

netsh works in Command Prompt and PowerShell on every supported Windows version. These are the commands from Microsoft’s netsh advfirewall article:
icmpv4:8,any means ICMP type 8 (Echo Request) with any code. Windows prints Ok. when the rule is added.

How to allow ping in the Windows Firewall console (GUI)

1

Open the firewall console

Press Win+R, type wf.msc and press Enter. This opens Windows Defender Firewall with Advanced Security (named Windows Firewall with Advanced Security in newer releases).
2

Open Inbound Rules

Click Inbound Rules in the left pane.
3

Enable the Echo Request rules

Find File and Printer Sharing (Echo Request - ICMPv4-In). Right-click each matching row and choose Enable Rule. Repeat for File and Printer Sharing (Echo Request - ICMPv6-In) if you use IPv6.
Enabled rules show a green tick. To build a new ICMP rule in the console, use Action > New Rule > Custom, choose ICMPv4 or ICMPv6 under Protocol type, click Customize, choose Specific ICMP types and select the echo request type (type 8 for ICMPv4, type 128 for ICMPv6).

How to allow ping only from certain IP addresses

To let only your monitoring service or office ping the server, limit the rule’s remote addresses:
-RemoteAddress accepts single addresses, CIDR ranges and ranges like 198.51.100.10-198.51.100.20. Set it back to Any to allow everyone again.

How to check it worked

From another computer (not the server itself), ping the server’s public IP:
For IPv6, run ping -6 2001:db8::10. In PowerShell, Test-NetConnection 203.0.113.10 shows PingSucceeded : True. On Linux or macOS, use ping -c 4 203.0.113.10. Request timed out means the reply is still blocked: check that the rule is enabled with the first command in this guide, and that no Block rule for ICMP exists.

How to block ping again

Remove a netsh rule with netsh advfirewall firewall delete rule name="ICMP Allow incoming V4 echo request".
Only change the Echo Request rules. Don’t block all ICMPv6: IPv6 needs other ICMPv6 messages (such as neighbour discovery) to work at all.

Frequently asked questions

Is it safe to allow ping on a server?

Answering ping lets monitoring tools and support staff confirm the server is online and run tests such as MTR and traceroute. It also makes the server easier for scanners to spot. If that concerns you, allow ping only from the addresses you trust.

Why can I ping out from my server but nobody can ping it?

Outbound pings and their replies are allowed by default. Inbound Echo Requests need an enabled inbound rule. Enable the Echo Request rules as shown above.

Does this work on Windows 10 and Windows 11?

Yes. The same rule names, PowerShell cmdlets and netsh commands work on Windows 10 and 11.

Do I need a separate rule for IPv6?

Yes. IPv4 uses ICMPv4 type 8 and IPv6 uses ICMPv6 type 128, so each needs its own rule.

Why does ping still fail after enabling the rule?

Test from a different network than the server. If it still fails, check for a Block rule (Get-NetFirewallRule -Action Block) and check any network firewall in front of the server, such as DDoS filters.

VPS and dedicated server guides

Every guide in this section.

Open a port in Windows Firewall

Inbound TCP and UDP rules.

Windows Server security checklist

Harden a new server.

Run MTR and traceroute

Trace the path to your server.

Enable IPv6 on Windows Server

Add and test an IPv6 address.

Checked against Microsoft Learn: New-NetFirewallRule, Enable-NetFirewallRule, netsh advfirewall and Configure firewall rules on 4 November 2026. Steps were not tested on a live Windows server for this page; menu names can differ slightly between Windows versions.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026