Fail2ban banned way to happy…..

on

Fail2ban happily blacklisted a bunch of ipadresses (putting ip addresses from naughty hacking users as DROP lines in iptables). Here I describe the commands to remove these banned ip addresses. Execute them as user root or sudo.

List all current iptable rules:

#iptables -L -n --line-numbers
[...]
Chain fail2ban-APACHE (3 references)
num target prot opt source          destination
1   DROP   all  --  192.168.2.23    0.0.0.0/0
2   RETURN all  --  0.0.0.0/0       0.0.0.0/0
[...]

Now you can remove that DROP line with this command (using the chain name and line number from above output):

#iptables -D fail2ban-APACHE 1

-D Delete matching rule from chain (fail2ban-APACHE in this case)
1  Rulenumber from chain