Enable ping in Windows 7 firewall?

3

2

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?

bernd_k

Posted 2011-10-04T12:44:47.843

Reputation: 1 181

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 – 2015-11-06T10:47:10.803

You could try adding it through the GUI? Control Panel --> System and security --> Windows Firewall --> Advanced settings --> Inbound rules --> New rule --> custom rule – jmreicha – 2011-10-04T13:35:57.093

Answers

7

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.

bernd_k

Posted 2011-10-04T12:44:47.843

Reputation: 1 181

2A number of blogging and content platforms have misguided "smart" quotes that mess up all kinds of code fragments. – RBerteig – 2012-08-02T23:21:56.727

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.

Justin Pearce

Posted 2011-10-04T12:44:47.843

Reputation: 2 712

This worked when I tried it. – Peter Mortensen – 2015-07-21T11:04:50.803

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). – Peter Mortensen – 2017-09-21T09:15:06.047

Or for later versions of Windows 10: Windows key, type "firew", and chose "Windows Defender Firewall". – Peter Mortensen – 2018-07-20T07:20:53.537

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

Pavenhimself

Posted 2011-10-04T12:44:47.843

Reputation: 131