First, output your currently fail2-banned IP's to a text file with the iptables commands:
iptables-save | grep '\-A fail2ban' | sed 's/\-A/iptables\ \-A/' > bannedIPs.txtStop fail2ban, make your config changes, etc. and restart:
service fail2ban stop
service fail2ban startLoad your iptables commands by piping your saved rules to bash:
cat bannedIPs.txt | /bin/bash
But does fail2ban know it has to remove banned IP after certain time?
ReplyDeleteUnfortunately not with this method. I'd like to know if you come up with a solution that would!
ReplyDeleteI published a script here
ReplyDeletehttp://www.fail2ban.org/wiki/index.php/Fail2ban:Community_Portal#Question_about_persistent_IP_address_bans_over_restart
what do you think?