I have
table ip nat {
chain Redirect_to_local {
limit rate 3/minute burst 10 packets log prefix "[nft.ip.dnat.8080]: "
redirect to :8080
}
chain PREROUTING {
type nat hook prerouting priority dstnat; policy accept;
iifname != { "lo", "ISP*" } fib daddr type != { local, multicast, broadcast } udp dport == 8000 counter jump Redirect_to_local
}
}
and it's incorrect because transport protocol mapping is only valid after transport protocol match
. But why? It DID match, but not directly there.
If I add udp dport == 8000
before redirect it will be accepted as correct, despite duplication of rule (which is annoying).
Is there a way to overcome this? Or did I misunderstand this?