info_i_25x25.png See important information about Ubiquiti Devices and KRACK Vulnerability in this article. We will update this document as more information becomes available.

EdgeRouter - How do I reorder firewall/NAT rules ?

Answer


Reordering/moving most firewall/NAT rules can be done via the GUI. However, some rules like firewall modify rules can only be reordered via the CLI.

In this example, we have one firewall modify rule (Rule #1) and want to move it down to Rule 10.

ubnt@ubnt:~$ configure
[edit]
ubnt@ubnt# show firewall modify
modify WLB {
rule 1 {
action modify
modify {
lb-group WLB
}
}
}
[edit]

All we need to do is "edit" the desired firewall chain and rename rule 1 to rule 10.

ubnt@ubnt# edit firewall modify WLB
[edit firewall modify WLB]
ubnt@ubnt# rename rule 1 to rule 10
ubnt@ubnt# commit; save

Now you can see that rule 1 have been moved down to rule 10.

ubnt@ubnt# show firewall modify
modify WLB {
rule 10 {
action modify
modify {
lb-group WLB
}
}
}
[edit]
ubnt@ubnt#