windows 2008 R2 advanced firewall netsh syntax

Posted on 2014-08-03
Last Modified: 2014-08-04

I'm experimenting with using the Windows 2008 R2 firewall to block external IP addresses from accessing one of our public facing servers.  I turned on the firewall and allowed all incoming public connections as a default with the intent to block those who were undesirable (hacking attempts, etc.).

I entered the following test netssh command at a command prompt:

netssh advfirewall add rule name="Blocked" dir=in action=block remoteip=

And got this as a result:
The following command was not found: advfirewall add rule name=Blocked dir=in action=block remoteip=

This is under Windows 2008 R2 standard.


Once this does work, if I wanted to have multiple remote IP addresses, how would I do that?  Can I add them to an existing rule, or do I have to make a new rule each time?

Thanks much!

Question by:Ben Conner
    LVL 12

    Expert Comment

    Pretty sure the syntax is:

    netsh advfirewall firewall add rule . . .
    LVL 12

    Accepted Solution

    You are also able to update exisisting rules using the "set rule" command. For explample, to add the ip to your existing rule, you'd use the following command:

    netsh advfirewall firewall set rule name="Blocked" new remoteip=,

    Author Comment

    by:Ben Conner
    Sigh.  Can't tell you how long I stared at that...  Thanks much!

    LVL 12

    Expert Comment

    Glad to help. I know how it feels. Sometimes you just need a fresh pair of eyes!

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Recently, I was asked to look into SCCM 2007 by my employer, having a degree of experience of earlier versions of SMS and some previous SCCM knowledge I didn't expect the procedure to involve to much time. I read a number of guides concerning it…
    Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
    This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now