
By default, Windows Firewall blocks incoming ping requests on most network profiles, so ping YOUR_SERVER_IP times out even though the server is up. That's fine for privacy, but annoying when you're testing connectivity or using a monitoring tool that relies on ping. This guide shows how to allow ping (ICMP Echo Request) with the firewall GUI, PowerShell or netsh, how to allow it only from certain IPs, and how to block it again. It applies to Windows Server 2016, 2019, 2022 and 2025, and to Windows 10 and 11.
Quick answer
New-NetFirewallRule -DisplayName "Allow ICMPv4 Ping" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -Action Allow
Or with Command Prompt: netsh advfirewall firewall add rule name="Allow ICMPv4 Ping" protocol=icmpv4:8,any dir=in action=allow
Why ping is blocked
Ping uses ICMP Echo Request messages (ICMP type 8). Windows ships built-in firewall rules for it, but they're disabled on the Public profile, and on many servers on all profiles. A VPS's network is usually classified as Public, so ping is blocked until you enable a rule.
Method 1: Enable the built-in rule in Windows Defender Firewall
- Press Win + R, run
wf.msc(Windows Defender Firewall with Advanced Security). - Click Inbound Rules.
- Find File and Printer Sharing (Echo Request - ICMPv4-In). On newer Windows Server versions you'll also see Core Networking Diagnostics - ICMP Echo Request (ICMPv4-In).
- Right-click the rule for the profile you use (Domain, Private or Public) → Enable Rule.
- For IPv6, enable the matching ICMPv6-In rule too.
Test from another computer with ping SERVER_IP.
Method 2: Enable ping with PowerShell
Enable the existing built-in rules:
Get-NetFirewallRule -DisplayName "*Echo Request*ICMPv4-In*" | Enable-NetFirewallRule
Or create your own rule, which is clearer and survives profile changes:
New-NetFirewallRule -DisplayName "Allow ICMPv4 Ping" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -Action Allow -Profile Any
New-NetFirewallRule -DisplayName "Allow ICMPv6 Ping" -Direction Inbound -Protocol ICMPv6 -IcmpType 128 -Action Allow -Profile Any
Method 3: Enable ping with netsh (Command Prompt)
netsh advfirewall firewall add rule name="Allow ICMPv4 Ping" protocol=icmpv4:8,any dir=in action=allow
netsh advfirewall firewall add rule name="Allow ICMPv6 Ping" protocol=icmpv6:128,any dir=in action=allow
netsh works on every Windows version, including Server Core and older systems.
Allow ping only from specific IPs
To let your monitoring service or office ping the server while hiding it from everyone else, add -RemoteAddress:
New-NetFirewallRule -DisplayName "Allow Ping from Monitoring" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 `
-RemoteAddress 198.51.100.25,203.0.113.0/24 -Action Allow
Disable ping again
# remove your own rules
Remove-NetFirewallRule -DisplayName "Allow ICMPv4 Ping"
# or disable the built-in ones
Get-NetFirewallRule -DisplayName "*Echo Request*ICMPv4-In*" | Disable-NetFirewallRule
# netsh equivalent
netsh advfirewall firewall delete rule name="Allow ICMPv4 Ping"
Without an allow rule, Windows Firewall drops ping requests silently, and the sender sees "Request timed out".
Still no reply?
- Provider firewall: many cloud and VPS providers have their own firewall or security group in front of the server. Allow ICMP there too.
- Third-party antivirus firewall: it may replace Windows Firewall rules; check its settings.
- Wrong IP: ping the server's public IP, not a private one, from outside.
- Testing the other way: outbound ping from the server is allowed by default; if it fails, the problem is network or DNS, not the inbound rule.
Should you allow ping on a server?
Allowing ping is generally low risk and makes troubleshooting and uptime monitoring much easier. Blocking it hides the server from simple scans but doesn't stop real attacks, because port scanners don't need ping. A good middle ground is allowing ping only from your monitoring and admin IPs.
Frequently asked questions
How do I enable ping on Windows Server?
Enable the "File and Printer Sharing (Echo Request - ICMPv4-In)" rule in Windows Defender Firewall, or create an ICMPv4 type 8 allow rule with PowerShell or netsh.
How do I enable ICMP on Windows 10 or 11?
Use the same steps: enable the Echo Request ICMPv4-In rule in wf.msc for your network profile, or run the netsh command as administrator.
Does enabling ping need a restart?
No. Firewall rule changes take effect immediately.
Is it safe to allow ping?
Mostly yes. If you prefer, allow it only from trusted IP addresses.


