Managing Mikrotik firewall through CLI/SSH interface
Change firewall rule order
One of the bad things in Mikrotik firewall is that when you add new rule, it’s automatically applied at the end of the chain, which in most of the times has NO EFFECT. So you need to fine-tune your rule position in order to make it work as supposeddFirst print the current rules
/ip firewall filter print without-paging
Now change the order, for example make rule number 18 to be number 1:
/ip firewall filter move 18 1
You MUST do /ip firewall filter print before actually moving the rule. Useless to say it's annoying when running batches with dsh or putty.
So you rsc would be:
/ip firewall filter print
/ip firewall filter move [find where comment ="blabla"] destination=32
Or in a single line: '/ip firewall filter print; /ip firewall filter move [find where comment ="blabla"] destination=32'