Security – Permanently and persistently ban an IP with fail2ban

fail2banSecurity

I have set up a custom jail for a spambot that is giving me trouble.
Using "bantime -1" I was trying to permanently ban the botnet. I thought it was working, but when the weekly logrotate occured fail2ban unbanned all IPs.

What is the best way to permanently and persistently ban an IP using fail2ban?

Is doing something like this + logging permanently banned IP to a seperate files (that does not get rotated) a good solution?

Cheers, Thomas

P.S.: I would like to do this without new cronjobs and scripts.
P.P.S.: I'm using Debian.

Best Answer

Put the ban in your permanent iptables configuration file (possibly /etc/sysconfig/iptables).