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.
2) Click on ‘Advanced Settings’.
Additionally, you can search for ‘Firewall’ in Windows search to reach the advanced Firewall settings as below.
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.
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.
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.
Very good article. Thanks for your help.
What about IPv6?
Excellent reference! Simple, clear and straightforward. Thanks a lot.
Thanks, Issue resolved.