Skip to main content

How to enable ping in the Windows server firewall?

Updated over 2 weeks ago

Introduction

By default, in Windows Server, the Windows Firewall is configured to block all inbound ICMP traffic. This includes requests that are common from ping, which can make network troubleshooting difficult.

This guide shows how to enable ping on a Windows 2022 server.

It is also valid for a Windows 2025 server.

1. Enabling ping via the command line

Simply run the command below in your Windows server terminal:

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow

To block ping:

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=block

2. Allow ping through the Windows Firewall

In the search bar, find 'Windows Defender Firewall with Advanced Security':

After the Windows Firewall is opened, select Inbound Rules, and New Rule:

We need to create a new ICMPv4 rule to unblock ping. In the first window, select Custom and press Next:

Select All programs, and Next:

Select ICMPv4 as Protocol type, and press Next:

Select Any IP address in both cases, and press Next:

Select Allow the connection, and press Next:

Select Domain, Private, Public, and press Next:

Give a name for the rule and confirm it. After, a new rule will be created:

In a couple of seconds, it will be marked green, and the server will become pingable:

To disable ping, simply change the rule from Enable Rule to Disable Rule.

The same rule can be created with ICMPv6 for IPv6.

Did this answer your question?