netsh firewall - Retail LAN
-
Tuesday, February 21, 2012 4:33 AM
Hi all,
Just would like to try and find out what is the proper command sequence I need to use for setting up a Windows Firewall batch script for retail stores (I work for a Point of Sale Hardware/Software Vendor)
Currently my command string for the section thats holding me up is as follows:
FOR /L %I%I IN (8030,1,8043) DO netsh firewall add portopening UDP %I%I "Logivision"%I%I ENABLE CUSTOM 192.168.140.0/24,192.168.140.0/255.255.255.0,LocalSubnet
netsh firewall add portopening UDP 9031 Logivision9031 ENABLE CUSTOM 192.168.140.0/24,192.168.140.0/255.255.255.0,LocalSubnetThis is the rule I need to create to enable the ports 8030 through 8043 through the firewall, while restricting it to the local subnet listed. I think I had it run once, but it seems this rule wont work on Windows Server 2003/2008, but has worked on Windows XP (ONCE, lol). The extra rule after it is also another one which I know will work, but this shows you the ports I need to allow through
Hows the best way I can go about this?
Suggestions/inputs appreciated :)
Regards
All Replies
-
Tuesday, February 21, 2012 6:20 AM
netsh ADVFIREWALL
o.
-
Tuesday, February 21, 2012 9:24 AMModerator
-
Wednesday, February 22, 2012 12:28 AM
Thanks for your replies all
I will give that a whirl and see how it goes and report back in a short while if its all worked
-
Wednesday, February 22, 2012 12:41 AM
That was negative. The server I am developing this firewall on did not like that. Came up and told me that advfirewall was not found
I just need to finish ironing out the bugs with this as well deploy to sites with a variety of OS's (Windows XP, Windows Server 2003 & Server 2008)
I've got most of the issues worked out, but its the little niggling ones that I cant work out, lol
My test server runs the following:
Windows Server 2003 Standard Edition SP2
Here's a pastebin dump of my systeminfo if its any help
With the command I listed to try and get it to add the ports automatically for me, it just keeps coming back to me telling me I is undefined at this time
- Edited by Nutterpc Wednesday, February 22, 2012 12:50 AM
-
Wednesday, February 22, 2012 8:29 AMModerator
Hi,
I test the command on Windows 2003 SP2, works change all %I%I to %I.
FOR /L %I IN (8030,1,8043) DO netsh firewall add portopening UDP %I "Logivision"%I ENABLE CUSTOM 192.168.140.0/24,192.168.140.0/255.255.255.0,LocalSubnet
Regards
Rick Tan
TechNet Community Support
- Edited by Rick TanModerator Wednesday, February 22, 2012 8:31 AM
- Marked As Answer by Rick TanModerator Thursday, February 23, 2012 1:14 AM
-
Wednesday, February 22, 2012 10:43 PM
Thanks rick.
I gave that a shot, still didnt seem to like me, I dont know why
But I just ended up creating the lines manually :) didnt want to, but will save hassle in the end
- Marked As Answer by Rick TanModerator Thursday, February 23, 2012 1:14 AM

