This may also be helpfull in pulling the " Bad " ip addresses.
I am not a coder so cant tell you exactly what it all means
Not sure where I found it, i beleive it looks in the fail2ban.log file
and pulls the banned IP`s
Save the file " getip.sh , chmod +x
I run it as:
./getip.sh > badip.txt
, then you can add to your own firewall. or maybe it can be automated
also, to add to iptables
Here is the scrip:
*
**#!/bin/sh**
**jails=$(fail2ban-client status | grep Jail\ list: | sed 's/.*Jail
list:\t\+//;s/,//g')**
**for jail in ${jails}; do**
** for ip in $(fail2ban-client status ${jail}|grep IP\ list|sed
's/.*IP list:\t//'); do**
** echo "fail2ban-client set ${jail} banip ${ip}"**
** done**
**done*
Dave M