Community discussions

MikroTik App
 
User avatar
Paradox
just joined
Topic Author
Posts: 20
Joined: Fri Oct 15, 2021 3:50 pm

Remove all firewall settings before import

Thu Dec 16, 2021 5:08 pm

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?
 
sid5632
Long time Member
Long time Member
Posts: 554
Joined: Fri Feb 17, 2017 6:05 pm

Re: Remove all firewall settings before import

Thu Dec 16, 2021 10:05 pm

/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]
 
User avatar
Paradox
just joined
Topic Author
Posts: 20
Joined: Fri Oct 15, 2021 3:50 pm

Re: Remove all firewall settings before import

Fri Dec 17, 2021 9:06 am

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.
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Remove all firewall settings before import

Fri Dec 17, 2021 11:36 am

This should work
/ip firewall filter remove [find dynamic=no]
 
User avatar
Paradox
just joined
Topic Author
Posts: 20
Joined: Fri Oct 15, 2021 3:50 pm

Re: Remove all firewall settings before import

Fri Dec 17, 2021 12:35 pm

Thanks, that one works!
 
gotsprings
Forum Guru
Forum Guru
Posts: 2115
Joined: Mon May 14, 2012 9:30 pm

Re: Remove all firewall settings before import

Fri Dec 24, 2021 2:24 pm

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.

Who is online

Users browsing this forum: No registered users and 17 guests