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

I created the following script basically to block absolutely everything and only allow through what I want, however it's not allowing through what I like in regards to the internet. Can anyone see an issue with my rules? Currently they are pretty generic.

@ECHO OFF

ECHO ========================================= Brendan Thompson - Firewall Policy - v1.0 =========================================

ECHO ----------------------------------------- Removing All Firewall Rules -----------------------------------------

ECHO Deleting all Incoming Firewall Rules
netsh advfirewall firewall delete rule name=all dir=in profile=any

ECHO Deleting all Outgoing Firewall Rules
netsh advfirewall firewall delete rule name=all dir=out profile=any

ECHO Delete all Remaining Firewall Rules
netsh advfirewall firewall delete rule name=all


ECHO ----------------------------------------- Initial Profile Setup -----------------------------------------

ECHO Block all Incoming and Outgoing Traffic on Domain Profile
netsh advfirewall set domainprofile firewallpolicy blockinbound,blockoutbound

ECHO Block all Incoming and Outgoing Traffic on Private Profile
netsh advfirewall set privateprofile firewallpolicy blockinbound,blockoutbound

ECHO Block all Incoming and Outgoing Traffic on Public Profile
netsh advfirewall set publicprofile firewallpolicy blockinbound,blockoutbound

ECHO ----------------------------------------- Domain and Private Profile - Incoming Application Exceptions -----------------------------------------
netsh advfirewall firewall add rule name="APP - BROWSER - Internet Explorer" dir=in action=allow profile=domain,private program="C:\Program Files\Internet Explorer\iexplore.exe"

ECHO ----------------------------------------- Domain and Private Profile - Outgoing Application Exceptions -----------------------------------------
netsh advfirewall firewall add rule name="APP - BROWSER - Internet Explorer" dir=out action=allow profile=domain,private program="C:\Program Files\Internet Explorer\iexplore.exe"

ECHO ----------------------------------------- Domain and Private Profile - Incoming Port Exceptions  -----------------------------------------
netsh advfirewall firewall add rule name="PORT - GENERAL - HTTP (80) - TCP" dir=in action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="PORT - GENERAL - HTTP (80) - UDP" dir=in action=allow protocol=UDP localport=80

ECHO ----------------------------------------- Domain and Private Profile - Outgoing Port Exceptions  -----------------------------------------
netsh advfirewall firewall add rule name="PORT - GENERAL - HTTP (80) - TCP" dir=out action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="PORT - GENERAL - HTTP (80) - UDP" dir=out action=allow protocol=UDP localport=80

Any ideas what's going wrong that would cause me not to be able to browse the web? :S

--Brendan

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Your rules are wrong. For Incoming Port Exceptions, you must allow traffic from port 80 to High port(1024 - 65535).

And for Outgoing Port Exceptions, you must allow traffic from High port(1024 - 65535) to port 80

Your traffic look like this

- Begin: You send HTTP request

  YourPC(High port) ----> (80)Webserver

- Then : Webserver send HTTP respone

  YourPC(High port) <---- (80)Webserver

Your rules does't allow these traffic, It only allows traffic to your machine port 80.

share|improve this answer

You need to allow DNS outbound (dst udp/53). I would suggest enabling the windows firewall logging on all profiles and review the log "c:\windows\system32\logfiles\pfirewall.log" to see what is being blocked.

Your outbound IE rules also need "localport" switched to "remoteport"

share|improve this answer

Your Answer

 
discard

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.