Friday, June 14, 2024
HomeHow toHow to whitelist an IP in Fail2ban on Debian Linux

How to whitelist an IP in Fail2ban on Debian Linux

Fail2Ban is used to protect servers against brute-force attacks. Fail2ban uses iptables to block attackers, so if we want to add permanent IP address and never be blocked, we must add it in the config file.

First, edit the config file :

nano /etc/fail2ban/jail.local

Suppose you do not have a jail.local file, edit the file jail.conf instead:

nano /etc/fail2ban/jail.conf

Then, check the line :

ignoreip =

Add all IP addresses you want now. Each IP or range IP must be separated here with a whitespace. Ex:


ignoreip =

The line should be added in the [DEFAULT] section of the file.

Save the file and restart Fail2Ban:

service fail2ban restart

That’s all.



Please enter your comment!
Please enter your name here

Most Popular