Fail2Ban is a brilliant piece of IDS (Intrusion Detection Software) that I've got a crush on.
I've developed a couple "jails" -- rules for banning IP addresses.
First, a couple thoughts, tricks, and tips:
Then refer to them like this:
NOTE the %(...)s do NOT forget trailing "s"!
NOTE the %(...)s do NOT forget trailing "s"!
I've had emails saying Fail2ban had banned an IP, but testing showed it didn't. WTF?!? This is important that this works!
When you run a new jail, or start one, also run:
sudo iptables -n --list
and watch for a "chain" for each of your jails, and, make sure each chain has a reference, like this:
If there are 0 (zero) references, then reload the chain's jail like this:
(substituting name of your jail with no references).
What happens is, sometimes the INPUT chain doesn't refer any packets to the fail2ban chain(s), so you'll get an email saying a ban has happened, but it hasn't taken effect, and leaves cryptic messages in /var/log/fail2ban.log.
Good luck with your fail2ban installation!
Attachment | Size |
---|---|
![]() | 1.96 KB |
![]() | 665 bytes |