View Full Version : SP2 firewall
Robbie Niblock
April 28th 05, 12:00 PM
Is there any way of opening a range of ports on the XP sp2 firewall? e.g. if
I want to open up ports 15000 - 15200 (udp and tcp).
Also - can I do this using GPOs?
Thanks in advance.
Robbie
S.Sengupta
April 28th 05, 12:46 PM
Control Panel > Windows Firewall > Exception > Add Port
Windows Firewall
http://msdn.microsoft.com/security/productinfo/XPSP2/networkprotection/firewall.aspx
regards,
ssg MS-MVP
Robbie Niblock wrote:
> Is there any way of opening a range of ports on the XP sp2 firewall? e.g. if
> I want to open up ports 15000 - 15200 (udp and tcp).
>
> Also - can I do this using GPOs?
>
> Thanks in advance.
>
> Robbie
>
>
Robbie Niblock
April 28th 05, 04:35 PM
Yea, that allows me to add specific ports - not a port range.
"S.Sengupta" > wrote in message
...
> Control Panel > Windows Firewall > Exception > Add Port
>
> Windows Firewall
> http://msdn.microsoft.com/security/productinfo/XPSP2/networkprotection/firewall.aspx
>
> regards,
> ssg MS-MVP
>
> Robbie Niblock wrote:
>> Is there any way of opening a range of ports on the XP sp2 firewall? e.g.
>> if I want to open up ports 15000 - 15200 (udp and tcp).
>>
>> Also - can I do this using GPOs?
>>
>> Thanks in advance.
>>
>> Robbie
Torgeir Bakken \(MVP\)
April 28th 05, 04:52 PM
Robbie Niblock wrote:
> Is there any way of opening a range of ports on the XP sp2 firewall?
> e.g. if I want to open up ports 15000 - 15200 (udp and tcp).
Hi,
Running netsh.exe in a script is an option.
The netsh.exe syntax is documented in WF_XPSP2.doc.
WF_XPSP2.doc "Deploying Windows Firewall Settings for Microsoft
Windows XP with Service Pack 2" is downloadable from
http://www.microsoft.com/downloads/details.aspx?familyid=4454e0e1-61fa-447a-bdcd-499f73a637d1
Example VBScript below, change name, scope, profile to
what fits you.
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
iPortStart = InputBox("Enter the first port you want to open", _
"Open a range of ports")
iPortStop = InputBox("Enter the last port you want to open", _
"Open a range of ports")
For i = iPortStart To iPortStop
oShell.Run "netsh.exe firewall add portopening protocol=all port=" & i _
& " name=BLA" & i & " mode=enable scope=subnet profile=domain", 0, True
Next
MsgBox "Finished adding ports", _
vbInformation + vbSystemModal, "Adding FW ports"
'--------------------8<----------------------
WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
S.Sengupta
April 28th 05, 07:37 PM
Run a script file, such as a batch file (*.BAT) or a command file
(*.CMD), that contains the series of Netsh commands to configure the
Windows Firewall operational mode, allowed programs, allowed ports, etc.
For more information about using Netsh to configure Windows Firewall.
Open Command Prompt window and type in:netsh firewall /?
which will diplay various options.
To use a BAT file and the NETSH FIREWALL command see the post of Doug
Knox MS-MVP here:'sp2 Firewall Port Range'
http://forum.iamnotageek.com/history/topic.php/656490-1.html
just change values accordingly:-
@Echo OFF
FOR /L %%I IN (15000,1,15200) DO NETSH FIREWALL ADD PORTOPENING TCP %%I
FTPPort%%I
Use the following command from the Run dialog:-
@Echo OFF
FOR /L %I IN (15000,1,15200) DO NETSH FIREWALL ADD PORTOPENING TCP %I
FTPPort%I
regards,
ssg MS-MVP
Robbie Niblock wrote:
> Yea, that allows me to add specific ports - not a port range.
>
>
> "S.Sengupta" > wrote in message
> ...
>
>>Control Panel > Windows Firewall > Exception > Add Port
>>
>>Windows Firewall
>>http://msdn.microsoft.com/security/productinfo/XPSP2/networkprotection/firewall.aspx
>>
>>regards,
>>ssg MS-MVP
>>
>>Robbie Niblock wrote:
>>
>>>Is there any way of opening a range of ports on the XP sp2 firewall? e.g.
>>>if I want to open up ports 15000 - 15200 (udp and tcp).
>>>
>>>Also - can I do this using GPOs?
>>>
>>>Thanks in advance.
>>>
>>>Robbie
>
>
>
vBulletin® v3.6.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.