6

I have added many rich rule with something like this:

 firewall-cmd --permanent --zone="thezone" --add-rich-rule='rule family=ipv4 source address=1.2.3.4 reject'

And now I would like to clear/remove all those rich rules in my "thezone" zone.

Also y try to remove line for line with :

 firewall-cmd --permanent --zone="thezone" --remove-rich-rule='rule family=ipv4 source address=1.2.3.4 reject'

or

 firewall-cmd --permanent --zone="thezone" --remove-rich-rule='rule family=ipv4 source address=1.2.3.4 accept'

or

 firewall-cmd --permanent --zone="thezone" --add-rich-rule='rule family=ipv4 source address=1.2.3.4 accept'

with the firewall-cmd --reload and still haven't succeed.

Can Anyone tell me how to clear all or tell what i'm doing wrong with one by one method?

Mik
  • 83
  • 1
  • 1
  • 6
  • for those who did not know theres is a xml file in /etc/firewalld/zones with the name of the zone like: the zone.xml and you can edit/remove rules there. – Mik Nov 04 '15 at 18:52

1 Answers1

4

Empty the contents of (or remove):

  • /etc/firewalld/zones/zone.xml
  • /etc/firewalld/zones/zone.xml.old

Note: where zone is the name of the zone you need to remove.

Then restart the firewalld service

user495489
  • 41
  • 2
  • This is the correct answer and is similar to @Mik who posted a comment on their own question. The filename in question might differ, for example, on my system it's `public.xml` and `public.xml.old`. I run Virtualmin / Webmin. – Eugene van der Merwe Nov 17 '21 at 06:34