In addition to what serbes said, I must warn you.
It is true that fail2ban prefers raw iptables rather than ufw or firewalld or another higher-layer helper. But, if you have some rule saving/restoring mechanism (like netfilter-persistent
in the Debian; I don't know how such thing is called in CentOS, sorry), there will be annoying catch. On restart, it will save fail2ban-added rules on the stop and restore them during startup, and fail2ban at the start will also add them again. So you'll end up with two identical fail2ban rule sets. On the next restart they will be multiplied again. And again.
This will not break things, but this somewhat obscures direct use of iptables. To conquer this you need to customise fail2ban actions. You need it to not install any firewall rules during jail startup, and then install these rules by hand and rely on your rule saving/restoring service. Also it's better to, say, set fail2ban to use ipset, and don't save ipsets by the rule saving service. This way everything will be clean.
Or, don't use rule saving/restoring service together with fail2ban.