fail2ban : Ban-Unban an IP address from cli
fail2ban : Ban-Unban an IP address from cli

Useful commands to ban or unban an IP address from cli. For that we will use the fail2ban-client command.

Unban

Before unban an ip address, you have to find the jail where the ip address has been ban. To do that, first identify the iptables rule name:
$ iptables -L -n
Find the jail name:
$ fail2ban-client status

and unban the ip address : fail2ban-client set yourjailname unbanip 10.20.30.45
If you use an older version (before v0.8.8) : fail2ban-client get yourjailname actionunban 10.20.30.45

Ban

It is almost the same to ban an ip address: fail2ban-client set yourjailname banip 10.20.30.45


Reference

Source

<>

My Powershell script categories

Ban-Unban an IP address from cli with fail2ban

Leave a Reply

Your email address will not be published.