How to add IP addresses to the whitelist in fail2ban on Ubuntu, Centos and Debian
Fail2ban is a useful program for protecting servers from brute force attacks. It reads log files and bans IP addresses detected as malicious. Fail2ban can be used for temporary or permanent IP banning. You can also whitelist any specific IP address to never be blocked through fail2ban. This guide will help you add IP addresses to the fail2ban whitelist on Ubuntu, Debian, and Centos systems.
First, make a local copy of jail.conf and edit it. On Debian-based systems, fail2ban configuration files are stored in the /etc/fail2ban directory.
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local vi /etc/fail2ban/jail.local
Now add your IP address under the ignoreip option in the DEFAULT section. Multiple IP addresses should be separated by a space. For example:
[DEFAULT] ignoreip = 192.168.10.100 192.168.2.0/32
After adding the IP address, save the file and restart the fail2ban service:
systemctl restart fail2ban