Easy to use

This guide will demo how to config fail2-ban for ssh.

Go to the /etc/fail2ban directory and edit jail.local file:
cd /etc/fail2ban/
vi jail.local
Edit the following configuration into it, just like below:
[sshd]
enabled = true
port = ssh
banaction = firewallcmd-ipset
action = %(action_mwl)s
logpath = %(sshd_log)s
maxretry = 3
findtime = 15s
bantime = 1h

Save and close it.

Now apply configuriton:
systemctl restart fail2ban
Finally, check banned IP of the sshd::
fail2ban-client status sshd