Firewalld – How to Prevent Firewalld from Killing Iptables

fail2banfirewalldiptables

I have centos7 with installed firewalld and fail2ban.
When i'm start firewalld(service firewalld start) it kills iptables (and starting iptables kills runing firewalld).
Can i remove iptables and use only firewalld?
Fail2ban action firewallcmd-ipset/allports/multiport use iptables to block.
Could someone explain right way to setup firewalld+fail2ban ?

Best Answer

You should not start the old iptables service if you intend to use firewalld. Start only firewalld and remove the other service.

The scripts comprising the old iptables service are in the RPM package named iptables-services, so you can remove this package from your system, and afterward use only firewalld.

yum remove iptables-services

(But do not remove the RPM package named iptables. You still need this as it contains the iptables command line tool.)

I recommend you set your fail2ban banaction to firewallcmd-ipset, as this gives the highest performance with very large lists of IP addresses.