We help IT Professionals succeed at work.

windows 2008 R2 advanced firewall netsh syntax

685 Views
Last Modified: 2014-08-04
Hi,

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=198.45.116.0/22

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

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!

--Ben
Comment
Watch Question

Commented:
Pretty sure the syntax is:

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

Author

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

--Ben

Commented:
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.

OR

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.