I created a default deny rule for DNS on my router. On fw3, by adding an override on the forwarding_rule chain, an exemption can be added to this default deny rule.
However, when this is converted to fw4 rules with the user_pre_forward chain, DNS queries are still blocked. Here is a dump of the active rules that was tested.
But why? The rule on "forward" chain is the default deny rule. The rule on "user_pre_forward" is the override. I expect the "user_pre_forward" to be evaluated first since priority is -1.
So I need to create another rule that will be jumped to by the pre_forward... Let me try that.
EDIT: Im still having doubts about creating another rule. Defeats the purpose of the pre_forward chain. In fw3, this is simple.
EDIT: Upon rechecking the documentation, I found this
Base chain priority
Each nftables base chain is assigned a priority that defines its ordering among other base chains, flowtables, and Netfilter internal operations at the same hook. For example, a chain on the prerouting hook with priority -300 will be placed before connection tracking operations.
NOTE: If a packet is accepted and there is another chain, bearing the same hook type and with a later priority, then the packet will subsequently traverse this other chain. Hence, an accept verdict - be it by way of a rule or the default chain policy - isn't necessarily final. However, the same is not true of packets that are subjected to a drop verdict. Instead, drops take immediate effect, with no further rules or chains being evaluated.
So, to summarize, the ACCEPT verdict on the pre_forward chain was hit but, another chain with the same hook was found and was executed.