Content #
Within iptables, the default policies appear to be exceptions to the first-matching-rule-wins scenario. The default policy commands are not position dependent. They aren’t rules, per se. A chain’s default policy is applied after a packet has been compared to each rule on the chain without a match. This is notably different for nftables where the first matching rule always wins and there is no default policy.
For nftables a drop rule for incoming traffic can be added to the end of the chain and a reject rule can be added to the end of the OUTPUT filter chain. This will have the same overall effect as the iptables default policies. But it’s important to note that these rules should be added at the end of the firewall script and only after other rules to allow traffic have been created above them. Otherwise all traffic will be dropped or rejected from the computer where the firewall is running, including possibly your SSH session for configuring the firewall!
...