Repository navigation
Conversation
…ting reject is not supported inside a prerouting hook: the kernel needs a routing decision to emit ICMP/RST and returns EOPNOTSUPP, so nftables aborts with Error: Could not process rule: Not supported fw4 loads the rule set as a whole, so a single rejected rule makes it keep the previous (empty) rule set: The rendered ruleset contains errors, not doing firewall restart. The result is that homeproxy_redirect* stay empty and client traffic bypasses the proxy completely - the panel shows healthy nodes and working latency tests, yet browsers cannot open Google/YouTube. Blocking QUIC on udp 80,443 only needs the packets to be dropped so browsers fall back to TCP, which drop does as well as reject and is valid in prerouting. Also replaces the profanity in the comment with a neutral description. Verified on ImmortalWrt 24.10 / kernel 5.4.302 / nftables 1.1.6: nft -c passes, firewall restart succeeds, redirect chains get rules and counters, clients reach YouTube/Google/GitHub while domestic sites stay direct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
现象
ImmortalWrt 24.10(kernel 5.4.302 / nftables 1.1.6)上启用 homeproxy 后,
/etc/init.d/firewall restart直接失败:fw4 的语义是「整份规则集要么全装、要么全不装」,因此一条规则被内核拒绝,等于所有规则都没装。表现为:
dstnat里的 TCP 重定向没有生效homeproxy_redirect*链全部为空(nft list ruleset | grep homeproxy为 0 条)排查时很容易误判成节点故障或 DNS 问题,因为代理进程本身是健康的。
根因
报错行只是定位点,真正被内核拒绝的是同一张链里的这条规则:
reject在 prerouting 钩子里不被内核支持——发 ICMP / TCP RST 需要路由结果,此时还没有,内核返回EOPNOTSUPP,nftables 记为Not supported。最小复现:
nft -c -f报Could not process rule: Not supported;把reject换成drop,校验立刻通过。改动
root/etc/homeproxy/scripts/firewall_post.ut,共 4 处(tproxy 与 tun 两个分支各 2 处):语义不变:这条规则的目的就是阻断 QUIC,让浏览器回落到 TCP。
drop与reject对客户端的效果一致(UDP 80/443 都不通),而drop在 prerouting 中合法。顺带把注释里的脏话换成中性描述。验证
设备:ARM64 / ImmortalWrt 24.10 / kernel 5.4.302 / nftables 1.1.6
nft -c -f/etc/init.d/firewall restartnft list chain inet fw4 homeproxy_redirect_lanac建议
后续在 prerouting 里做阻断动作统一用
drop;reject只适用于 input / forward / output 钩子。