Windows 8 – 来自命令行的防火墙问题

我创build了下面的脚本基本上阻止绝对的一切,只允许通过我想要的,但它不允许通过我喜欢的互联网。 任何人都可以看到我的规则问题? 目前他们是相当通用的。

@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 

任何想法有什么问题会导致我无法浏览网页? :S

–Brendan

你的规则是错误的。 对于Incoming Port Exceptions ,您必须允许从端口80高端口(1024 – 65535)的stream量。

而对于Outgoing Port Exceptions ,您必须允许从高端口(1024 – 65535)到端口80的stream量

你的stream量是这样的

 - Begin: You send HTTP request YourPC(High port) ----> (80)Webserver - Then : Webserver send HTTP respone YourPC(High port) <---- (80)Webserver 

您的规则不允许这些stream量,它只允许stream量到您的机器端口80。

您需要允许DNS出站(dst udp / 53)。 我build议启用所有configuration文件的Windows防火墙日志logging,并查看日志“c:\ windows \ system32 \ logfiles \ pfirewall.log”以查看被阻止的内容。

您的出站IE规则还需要将“localport”切换到“remoteport”