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?

1
  • 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
    Commented Nov 4, 2015 at 18:52

1 Answer 1

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

1
  • 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. Commented Nov 17, 2021 at 6:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .