Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Dumb question:

Is there an equivalent of iptables on Windows? Could I install one via cygwin?

The real question: how can I accomplish on Windows what I can accomplish via iptables? Just looking for basic firewall functionality (e.g. blocking certain IP addresses)

share|improve this question
No such thing as a dumb question –  Mark Henderson Nov 30 '10 at 23:07
Of course there's such a thing as a dumb question, this just isn't one. –  Task May 29 '14 at 17:36

3 Answers 3

up vote 21 down vote accepted

One way would be with the netsh command:

share|improve this answer
+1 - netsh advfirewall is an absolute nessesary rule to learn for anyone scripting anything security related on Windows Server –  Mark Henderson Nov 30 '10 at 23:06
exactly what i was looking for, thanks. –  Aaron F. Nov 30 '10 at 23:28
Does netsh advfirewall support URLs, or just IP addresses? –  Parker Apr 26 '13 at 1:55
Just IP addresses and such, though it can also filter based on the executable sending or receiving network traffic, or the AD credentials of the user/group/computer involved. For URL filtering, you'd want to look for a filtering proxy of some kind. –  James Sneeringer Apr 26 '13 at 14:11

WIPFW looks very promising, especially if your after that iptables rule creation flavor.

share|improve this answer

There is a built-in firewall in XP, Server 2003 and later releases.

It has an API through which you can programatically change, enable, and disable rules.

share|improve this answer
I want something I can access programmtically -- add IP addresses to the firewall from within a script or software module. –  Aaron F. Nov 30 '10 at 22:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.