mangle rules order question!

Hi,

If i want to use mangle to mark some paquets, said for example in routing…

[admin@MikroTik] /ip firewall mangle> add action=mark-routing new-routing-mark=to-22 src-address=10.10.1.0/24 dst-address=10.10.4.0/24 chain=prerouting

[admin@MikroTik] /ip firewall mangle> add action=mark-routing new-routing-mark=to-32 src-address=10.10.1.0/24 dst-address=10.10.4.1/32 chain=prerouting

if i have these two rules, does it really care the order i put them into RouterOS… i mean if having in mind these two rules i send one packet from address=10.10.1.0/24 to address 10.10.4.1 it will be marked with label to-32…? or as the first rule also match and is in the first position it will be marked with label to-22…??

The rules are processed from the top down. If you pass though, it will continue to run even if it matches, else it will stop. For performance reasons, you want to match the most of your traffic at the top and stop processing rules as quickly as possible.

However, two rules, no biggy. What happens the first one matches, applies the mark and then the second matches and applies another mark. If the second don’t match, then no biggy. If you have pass though off, then it process the first one, it will mark and stop processing.