Enable ping in Windows 7 firewall?

19,639

Solution 1

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.

Solution 2

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.

Solution 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
Share:
19,639

Related videos on Youtube

ziegler zhang
Author by

ziegler zhang

Database developer for SQL-Server and ORACLE. Doing a lot with PowerShell. I'm German and it is now only 4 years that I started bloging (in english) and now i'm contibuting to several OpenSource Projects. Codeplex SQLPSX is the most important of them.

Updated on September 18, 2022

Comments

  • ziegler zhang
    ziegler zhang almost 2 years

    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?

    • jmreicha
      jmreicha over 12 years
      You could try adding it through the GUI? Control Panel --> System and security --> Windows Firewall --> Advanced settings --> Inbound rules --> New rule --> custom rule
    • Daniel B
      Daniel B over 8 years
      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.
  • RBerteig
    RBerteig almost 12 years
    A number of blogging and content platforms have misguided "smart" quotes that mess up all kinds of code fragments.
  • Peter Mortensen
    Peter Mortensen almost 9 years
    This worked when I tried it.
  • Peter Mortensen
    Peter Mortensen almost 7 years
    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
    Peter Mortensen almost 6 years
    Or for later versions of Windows 10: Windows key, type "firew", and chose "Windows Defender Firewall".
  • AntoineL
    AntoineL about 3 years
    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.