firewall-cmd remove rich rule fails

bluethundr picture bluethundr · Oct 11, 2017 · Viewed 17.8k times · Source

I'm trying to remove some rich rules from firewall-cmd and it seems to work:

 firewall-cmd --remove-rich-rule 'rule family="ipv4"   source address="10.4.220.143/32"   port protocol="tcp" port="13782" accept'

success

But after I reload the rules and check again, the rules are still there:

firewall-cmd --reload

success

# firewall-cmd --list-all
    rule family="ipv4" source address="10.4.220.143/32" port port="13724" protocol="tcp" accept

What am I doing wrong?

Answer

John117 picture John117 · Oct 30, 2017

I think you have to add a < --permanent > statement to make your change permanent after reloading your firewall config.

firewall-cmd --permanent --remove-rich-rule 'rule family="ipv4" source address="10.4.220.143/32" port protocol="tcp" port="13782" accept'