Windows Server 2022 does not respond to the ‘ping’ command by default. This is because the default configuration of Windows firewall is configured to drop all inbound ICMP traffic, but this can make network troubleshooting difficult
Here’s how you can allow ping through Windows Firewall in Windows Server 2022 with command line or through the graphical user interface (GUI).
1. Command Line
Simply run this command in command prompt or PowerShell to allow ping requests in from any source:
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
Alternatively, you can use the Windows graphical user interface to allow this:
2. Allow ping through Windows Firewall GUI
- First we need to open Windows Firewall, this can be done a few ways. My favorite method is to simply hit the Windows key to open start, then start typing firewall. As shown below Windows Firewall with Advanced Security should show, click this.
Alternatively you can simply type ‘firewall’ and press enter in PowerShell to open the basic firewall interface
- Scroll down and click “Advanced Settings”.
- From the Windows Defender Firewall with Advanced Security window that opens up, select Inbound Rules from the menu on the left.
- From the rules listed under Inbound Rules, select “File and printer Sharing (Echo Request – ICMPv4-In)” and enable the rule.
Note that this will only allow IPv4 requests in, you can customize the rule to only allow certain IP addresses in if required.
If you need IPv6 then you will want to enable the “File and Printer Sharing (Echo Request – ICMPv6-In)” rule, listed just below.
- Once enabled the server should now respond to ping requests. From my desktop I begun to ping my Windows Server 2022 virtual machine at 192.168.162.185 before enabling the rule, and then again after enabling it. You can see below that the first requests timed out, as inbound ICMP requests were disabled by default in Windows Server 2022. As soon as the ICMP rule was enabled, the ping requests start to succeed, confirming that this is working as expected.
Summary
By Default Windows Firewall prevents ICMP echo requests, this results in the server not responding to ping. By enabling this firewall rule we have enabled ping in Windows Server 2022, which can help us with network troubleshooting.
0 Comments.