将我的 FreeBSD 系统从 12.2 升级到 13.0-p3 后,PF 阻止了所有流向我的监狱的流量。禁用 PF 时,一切正常(除了不受保护;))
我试图通过设置'block in log all'来弄清楚是什么规则阻止了这个流量,但是除了一些明显的多播内容之外,没有任何东西可以解释为什么这个流量被阻止了。
同样,在 12.2 版本下一切正常之前。我确实找到了一些关于 v13 现在过滤 VLAN 而不是 lo0 的文章,但我不使用任何 VLAN。
我应该进一步寻求什么方向?
2021 年 7 月 15 日更新:
为清楚起见:这是我的 pf_rules 文件:
set block-policy return
set optimization aggressive
set skip on { lo0, lo1, lo2, lo3, lo4, lo5 }
ext_if=hn0
ext_address="{ 192.x.x.x, 2001:981:x.x::x }"
ext_services = "{ ssh, http, https, smtp, smtps }"
tcp_services = "{ ftp, ssh, domain, ntp, www, smtp, smtps, submission, http, https,nfs}"
udp_services = "{ domain, ntp, nfs }"
icmp6_types="{ 2, 128 }" # packet too big, echo request (ping6)
icmp6_types_ext_if="{ 128, 133, 134, 135, 136, 137 }"
jail_net = "192.168.1.0/24"
jail_services = "{ mysql, http, smtp, 587, 3000 }"
table <sshguard> persist
scrub in all
nat pass on $ext_if from $jail_net to any -> $ext_address
block in log on $ext_if proto tcp from <sshguard> to any port ssh label "ssh bruteforce"
block in log all
pass in quick from <pf_whitelist> flags S/SA synproxy state
pass out on $ext_if inet6 proto icmp6 all icmp6-type echoreq keep state
pass out on $ext_if inet proto udp to port 33433:33626
pass out on $ext_if inet6 proto udp to port 33433:33626
pass in on $ext_if inet6 proto ipv6-icmp icmp6-type $icmp6_types keep state
pass in on $ext_if inet6 proto ipv6-icmp from any to { ($ext_if ), ff02::1/16 } icmp6-type $i
cmp6_types_ext_if keep state
pass in on $ext_if proto tcp from any to $ext_address port $ext_services keep state
pass in on $ext_if inet6 proto tcp from any to $ext_address port $ext_services keep state
pass out on $ext_if inet proto tcp to any port $tcp_services keep state
pass out on $ext_if inet6 proto tcp to any port $tcp_services keep state
pass out on $ext_if inet6 proto udp to any port $udp_services
pass proto udp to any port $udp_services keep state
pass in proto tcp from any to $jail_net port $jail_services keep state
pass out proto tcp from $jail_net to any port $jail_services keep state
pass inet proto icmp from any to any
这已经工作了很多年,直到 FreeBSD 13
引用TCP SYN 代理:
| 如果 PF 在网桥(4) 上运行,SYN 代理将不起作用。
删除标志synproxy
试试吧
如果这可行,您可以将其仅用于监狱,并为其他人保留同步代理,例如
显然,这与 PF 无关,而是与从 12.2 版升级到 13.0 版的过程有关。在物理服务器上安装版本 13 并使用一些服务创建监狱工作正常。所以它可能与虚拟服务器上的升级有关,无论是 Hyper-V 还是其他东西。我仍然不知道设置和配置中的所有内容看起来都一样(我从升级的虚拟服务器复制的大部分内容都不起作用)