I am trying to convert firewall rules from a working CentOS hotspot server (not related to
Mikrotik’s hotspots). I have many years of experience with firewall rules, linux and sys administration
but clearly I am not as bright as I think I am.
I am running a small RB750 in default setup, version 5.6
As an example only, I have one chain under NAT called DNAT with one rule that says to dnat anything that comes
to that rule destined for port 80 to be redirected to 64.57.176.23 port 80.
Then under mangle I have one rule in chain prerouting that says to jump to chain DNAT for any packet with src:0.0.0.0/0 and dst:0.0.0.0/0 with proto tcp and dst port 80.
This second rule remains in red, telling me there is an error. It would be useful if error
messages were available that were explicit. The DNAT rule was created first, and the prerouting
rule created second.
as andriys writes - you cannot jump from one facility chain to another facility.
You can check packet flow diagram to see where packets have to go to reach your intended destination. Meanwhile you have to process them where they are (add mark or something) that you know that these are special packets when reaching NAT facility.
“Destination NAT” is a part of Prerouting. It is the next functional block that packets enter after the “Mangle Prerouting”. I think what you need is to create your JUMP rule in “/ip firewall nat”.