How to Enable/Disable Ping in Windows Server 2019/2016/2012 R2 Firewall

In this guide, we will learn how to enable (and disable) ping response in Windows 2019/2016 and 2012 R2 servers. Though the original post was written with the screenshots from Windows 2012 R2 server, the same steps are applicable to any recent Windows servers.

Enabling ping will help you to monitor and troubleshoot network issues on your network. Based on your domain environment policies and settings, the ping request will work accordingly. If it works by default, we will also show you how to disable the ping in Windows servers. By the way, we have mentioned the Powershell commands if you want to work on a remote system or Core edition of Windows OS.

Read Also: How to enable ping on Windows 10 client PC

Allow Ping in Windows Server 2019/2016 – GUI

1) Go to control panel and open ‘Windows Firewall’. There are plenty of ways to reach control panel on a Windows server.

Windows firewall

2) Click on ‘Advanced Settings’.

Firewall advanced settings

Additionally, you can search for ‘Firewall’ in Windows search to reach the advanced Firewall settings as below.

Search For Windows Firewall

3) In the earlier Operating Systems, we need to create a firewall rule to allow ICMP echo packets. Luckily the rule is already there and we just need to enable it.

To enable the inbound rule that allowing ICMP packets, select ‘Inbound Rules’. Locate the ‘File and Printer Sharing (Echo Request –ICMPv4-In’), right-click on it and select Enable Rule.

Enable Ping on Windows Server

That will allow incoming ping requests and respond to them without completely disabling Windows firewall service. As we enabled this rule only for IPv4 packets, we need to enable the separate similar rule for ICMPv6-In for IPv6 network.

Below screenshot shows a Windows server started responding to ping request one the above rule was enabled.

Ping reply on Windows server

In a similar scenario, if a server is responding to ping/ICMP requests, but you need to stop it for tight security, you can simply disable the same rule.

Visit the Windows firewall advances settings and disable ‘File and Printer Sharing (Echo Request –ICMPv4-In’) rule.

Enable/Disable Ping by PowerShell Commands

Geeks like command lines, especially Windows OS admins love PowerShell. Below commands can be used to enable/disable ping on Windows Server and Client Operating Systems. Especially if you work on remote systems via PowerShell or you have the Server Core OS without GUI.

Make sure to run below commands ‘as administrator’ on command prompt or PowerShell.

Enable IPv4  – This will create an exception in the default Windows firewall rule.

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

For IPv6:

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

To disable ping on IPv4:

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

For IPv6:

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

As ping is a useful utility to troubleshoot and find the presence of a network device, it is completely depending on the network security policies of your environment to enable or disable it. We mentioned the easy steps you can do by GUI and command prompt in this guide.

Dinesh is the founder of Sysprobs and written more than 400 articles. Enthusiast in Microsoft and cloud technologies with more than 15 years of IT experience.

3 thoughts on “How to Enable/Disable Ping in Windows Server 2019/2016/2012 R2 Firewall”

Leave a Comment

Pin It on Pinterest

Shares