SP2 Firewall exception for all ports against an IP

G

Guest

How is it possible set to an exception that allows access to all ports on an
XP SP2 machine from a specific IP (or range of IPs)?
 
M

Matija Hrovat

Hi,
I quite honestly don't know why would you do that ?
Just open the ports that you need and set the right scope to them.
With that said, here you have an example of a code that you could use

open notepad and copy the following text in and save as .vbs
To open a range of ports:
---------------------------------------------
Dim WSHShell, PortStart, PortStop
Set WSHShell = WScript.CreateObject("WScript.Shell")

PortStart = inputbox("The first port you want to open" , "Open a range of
ports")
PortStop = inputbox("The last port you want to open" , "Open a range of
ports")
for i = PortStart to PortStop

WSHShell.run ("netsh firewall add portopening protocol = all port = " & i &
" name = BLA" & i & " mode = enable scope = CUSTOM addresses = 1.1.1.1")
next
---------------------------------------------

To delete a range of ports:
---------------------------------------------
Dim WSHShell, PortStart, PortStop
Set WSHShell = WScript.CreateObject("WScript.Shell")

PortStart = inputbox("The first port you want to delete" , "Delete a range
of ports")
PortStop = inputbox("The last port you want to delete" , "Delete a range of
ports")
for i = PortStart to PortStop

WSHShell.run "netsh firewall delete portopening protocol = all port = " & i


next
---------------------------------------------
Not a pretty one but it will do the job :)

You can get additional help on opening ports in command prompt by typing:
netsh firewall add portopening /?

!!!!!!!!!!!!!!!!!Once again rather than opening ALL the ports open those you
need:!!!!!!!!!!!!!!!!!!!!
http://docs.hp.com/en/5990-7252/ch01s01.html

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top