Categories
Ye Olde Garden

More ways to unban an IP from iptables

Since my iptables keeps growing, listing the whole table can take more than a few minutes these days. I dug around and found a couple of options that will do the job faster:

iptables -D chainname -s theipaddress -j DROP

Alternately, you can list:
iptables -L -v --line-numbers

Then delete:
iptables -D chainname linenumber_of_IP_to_delete

This will make cleaning up the Fail2Ban tables a lot easier, especially if one of your users decides to ban himself and you have to sift through a ton of numbers to find his IP.