Move firewall rules

Hello,

I add a firewall rule to the Mikrotik:

/ip firewall filter
add chain=input dst-port=161 protocol=udp action=accept

But the problem is that it goes to the end of the rules, so it is not working:

/ip firewall filter export 
# dec/17/2015 16:12:07 by RouterOS 6.33.3
# software id = 9DRR-XSRN
#
/ip firewall filter
add chain=input comment="default configuration" protocol=icmp
add chain=input comment="default configuration" connection-state=\
    established,related
add action=drop chain=input comment="default configuration" in-interface=\
    ether1-gateway
add chain=forward comment="default configuration" connection-state=\
    established,related
add action=drop chain=forward comment="default configuration" \
    connection-state=invalid
add action=drop chain=forward comment="default configuration" \
    connection-nat-state=!dstnat connection-state=new in-interface=\
    ether1-gateway
add chain=input dst-port=161 protocol=udp

Where is the good place to put it? on the top? How could I move with command line?

Thanks and regards.

move X Y

X is the rule to move, and Y is the rule that X gets inserted before.


Example:

/ip firewall filter
add chain=forward comment=rule0
add chain=forward comment=rule1
add chain=forward comment=rule2
move 0 2
print

Flags: X - disabled, I - invalid, D - dynamic 
 0    ;;; rule1
      chain=forward action=accept log=no log-prefix="" 

 1    ;;; rule0
      chain=forward action=accept log=no log-prefix="" 

 2    ;;; rule2
      chain=forward action=accept log=no log-prefix=""

If you don’t specify Y, then it moves the rule to the end of the chain.

Thanks!

It works!

Best regards.