Run command after fail2ban block


Actually I’m working with FreePBX and have configured fail2ban to block the IP addresses when try to access to extension by brute force, after work send email by default, i would like to know if is possible add a custom command when do this, i would to block the ipaddress by iptables also.

Thank you advance, best regards.

That is exactly how fail2ban works, it adds an entry to iptables to ban the offending IP for “bantime”, if setup properly it will also email you of it’s action.

So what is not working for you?

1 Like