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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social Media Auto Publish Powered By : XYZScripts.com
%d bloggers like this: