We help IT Professionals succeed at work.

windows 2008 R2 advanced firewall netsh syntax

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!

Watch Question

Pretty sure the syntax is:

netsh advfirewall firewall add rule . . .
This one is on us!
(Get your first solution completely free - no credit card required)
Ben ConnerCTO, SAS developer


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


Glad to help. I know how it feels. Sometimes you just need a fresh pair of eyes!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.