Documentation / Tutorials / Server
Remove ban from IPs banned by Fail2Ban
/ Server / Remove ban from IPs banned by Fail2Ban
Assuming you have secured your server using fail2ban, there comes a time when you may ban an IP wrongly. Here is how you can quickly check if that IP is banned and then un-ban it.
this command will give you a list of all the IPs banned by fail2ban and the Jail under which it has been banned. if you the name of the jail you can check it using the following command as well.
where wordpress2 is the name of the jail, as defined in jail.conf file.
Once you have verified the IP, if it is banned you can use above command to remove the ban, wordpress2 is the name of the jail, while IP 188.8.131.52 is the IP which is being removed from ban.
If you have static IPs then you can whitelist them so that they do not get banned, it can be done by setting ignoreip in jail.conf or jail.local file. Here is an example of it
You can see how a range of IPs or multiple IPs can be added. Afterwards, remember to restart the fail2ban server using