Page 1 of 1

Remove all firewall settings before import

Posted: Thu Dec 16, 2021 5:08 pm
by Paradox
Hi,
I want to sync my firewall settings from one VRRP router to another. Therefore I'm exporting the rules with
/ip firewall export file=firewallrules
. But before import on the second router I have to wipe out all firewall settings. How could I do this?

Re: Remove all firewall settings before import

Posted: Thu Dec 16, 2021 10:05 pm
by sid5632
/ip firewall filter remove [find]
/ip firewall nat remove [find]
/ip firewall raw remove [find]
/ip firewall mangle remove [find]
/ip firewall address-list remove [find]
/ip firewall layer7-protocol remove [find]
/ip firewall connection remove [find]

Re: Remove all firewall settings before import

Posted: Fri Dec 17, 2021 9:06 am
by Paradox
Thanks! But sorry, I've fogot to mention that I've already tried this one:
/ip firewall filter remove [find]
But it gives the error
failure: cannot remove builtin
and does not remove any rules.

I guess this is because of rule 0, which is a builtin rule for fasttrack.

Re: Remove all firewall settings before import

Posted: Fri Dec 17, 2021 11:36 am
by karlisi
This should work
/ip firewall filter remove [find dynamic=no]

Re: Remove all firewall settings before import

Posted: Fri Dec 17, 2021 12:35 pm
by Paradox
Thanks, that one works!

Re: Remove all firewall settings before import

Posted: Fri Dec 24, 2021 2:24 pm
by gotsprings
I use find comment = "defcon" on new routers.

Will have to try that dynamic no at some point on a running router.

Thing is... I import my new rules THEN delete the old ones.