C:\Program Files\App\app.exe
192.168.1.0/24
文件和打印机共享(回显请求 - ICMPv4-In)
# 查看所有规则 netsh advfirewall firewall show rule name=all # 添加入站规则(允许80端口) netsh advfirewall firewall add rule name="HTTP" dir=in action=allow protocol=TCP localport=80 # 添加出站规则(阻止某程序) netsh advfirewall firewall add rule name="BlockApp" dir=out action=block program="C:\App\app.exe" # 启用/禁用规则 netsh advfirewall firewall set rule name="规则名" new enable=yes/no # 删除规则 netsh advfirewall firewall delete rule name="规则名"
%systemroot%\system32\LogFiles\Firewall\
gpedit.msc
通过合理配置入站/出站规则,可以在不影响正常业务的前提下,显著提升系统安全性。建议结合网络需求制定明确的防火墙策略文档。