Thursday, March 8, 2012

How to open a set of ports in windows firewall?

Go to Control Panel > Windows Firewall (or type firewall.cpl in the Run prompt). Under the Exceptions tab you can add the program or port number to which you would want to allow access.

If you want to add multiple ports there is no option for you to open multiple ports (port range) with a simple addition of a filter.

To do this we need to type the following in the command prompt (Run > cmd):

FOR /L %I IN (9000,1,9100) DO netsh firewall add portopening TCP %I "Site Ports" %I

The ports will be incremented by 1 from 9000 until 9100.

In windows 2008 it is much easier than this. You can easily add a port range in the Firewall filter rules

No comments:

Post a Comment