3

Server Fault tells that the new syntax to enable ping on Windows Server 2008 is

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

but this doesn't work with Windows 7. Here I get

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

A specified value is not valid.

Usage: add rule name=<string>
...

What is the correct new syntax?

2
  • You could try adding it through the GUI? Control Panel --> System and security --> Windows Firewall --> Advanced settings --> Inbound rules --> New rule --> custom rule
    – jmreicha
    Oct 4, 2011 at 13:35
  • Windows ships with a firewall rule for that, btw. Confusingly, it’s in the File and Printer Sharing category. Its name depends on your OS language.
    – Daniel B
    Nov 6, 2015 at 10:47

3 Answers 3

8

The problem is copy and paste. With the right quotation marks

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

does the job. I'm not sure from which source I copied the problematic version.

1
  • 2
    A number of blogging and content platforms have misguided "smart" quotes that mess up all kinds of code fragments.
    – RBerteig
    Aug 2, 2012 at 23:21
3

When I typed:

netsh advfirewall firewall add rule name="Enable Echo Ping Request" protocol=icmpv4:8,any dir=in action=allow

into my Windows PowerShell ISE, I got an error: "A specified protocol value is not valid."

I fixed it by using this:

netsh advfirewall firewall add rule name="Enable Echo Ping Request" protocol="icmpv4:8,any" dir=in action=allow
1
  • Note that your fix is specific to Powershell (you need to protect the ,), it won't happen if you were using the traditional CMD command line as did the OP.
    – AntoineL
    Apr 22, 2021 at 7:56
3

Control Panel --> System and Security --> Windows Firewall --> Advanced settings --> right click on Inbound rules --> New rule --> Custom rule -> Next

In Protocol and ports (chosen in the left panel): Protocol: ICMPv4

In the same panel, press button Customize, choose "Specific ICMP types", check the box "Echo Request", and press button OK.

In Name (chosen in the left panel): fill in the Name field and press Apply.

3
  • This worked when I tried it. Jul 21, 2015 at 11:04
  • On Windows 10, hit the Windows key, type "fire", and chose "Windows Firewall". On the last screen the button to use is "Finish" instead of "Apply" (as it does not exist). It starts working immediately (no restart, etc. needed). Sep 21, 2017 at 9:15
  • Or for later versions of Windows 10: Windows key, type "firew", and chose "Windows Defender Firewall". Jul 20, 2018 at 7:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .