My router in a virtual machine x86 is still on 21.02.
I want to move it to 22.03 and when I created another vm x86 with 22.03 to see the differences I noticed that the custom rules tab in the firewall section is gone.
Change your iptables calls to iptables-translate on some machine that has that package installed (maybe already on your router) and see what it generates. You'll also need to look at the new rule structure and chain names to see where they go.
As far as I can tell, it should look something like this:
You can use nft list ruleset to view the whole collection as it currently exists. You can view just a single chain using nft list chain inet fw4 dstnat, plus you could just execute any of the above commands and then immediately list its chain to see its effect.
Other stuff that might be handy:
Adding -a, as in nft -a list blah blah, shows the "handle" of each rule
nft delete rule inet fw4 dstnat handle NNN removes the rule from that chain
Handles are dynamic, so every time you create one it's incremented and never reused until you restart the firewall from scratch (fw4 restart).
BTW, I see no reason for these custom rules. They could be reduced/converted to UCI format - then it'll be no need to translate. These rules seem fairly basic.
@lleachii
I'm sure these rules are basic. I am not the greatest firewall person. However, this is the only rules I have in my current custom rules tab which forces all clients to use my pihole for dns.
I am just trying to figure out how to get the same results in 22.03.
Correct, I was suggesting placing the rules into the UCI-standard file /etc/config/firewall.
To do so - I suggested translating into UCI instead of raw nft.
This lends me to believe you have an interface unassigned to a Zone in the firewall. Zones that need masquerade can be set with a simple check on the web GUI. This is just one example. Seeing that file would be helpful.
config redirect
option target 'DNAT'
option src 'lan'
option proto 'tcp'
option proto 'udp'
option src_dport '53'
option dest_port '53'
option name 'xxxxx'
option dest_ip x.x.x.253'
The 3 remaining rules: TCP, UDP then specifying the SRC - are all repetitious and redundant. Regarding the last 2 input from SRC rules - an input allow rule on the correct zone would allow this traffic.
They probably could be reduced to uci but since I use linux in other areas it would benefit me more to learn nftables so that I can apply it to other systems.