How can I tell if my IP has been blocked by my server's firewall?

Procédure

Presentation

Fail2ban is an anti-brute-force software that we install with all our ISPconfig packages.

It protects your VPS against people trying to "crack" your passwords.

By analysing your server's log files, it detects failed connection attempts on several services. Whether it's SSH, FTP, IMAP or MySQL.

The only problem is that your IP address may be blocked. It could happen that you have forgotten your MySQL password and you make several erroneous connection attempts.

Enough to get you blocked by Failban.

We'll look at how to find the list of IPs blocked by Fail2ban and how to unblock them.

Find the list of IP's blocked by Fail2ban

Go to your ISPconfig panel and under the Monitoring tab, View IPTables section:

How can I tell if my IP has been blocked by my server's firewall?

How can I tell if my IP has been blocked by my server's firewall?

You will find something like this:

How can I tell if my IP has been blocked by my server's firewall?

For the moment nothing abnormal. To find a blocked IP you will need to look for lines like :
fail2ban-SERVICE -s IP -j REJECT --reject-with icmp-port -unreachable

How can I tell if my IP has been blocked by my server's firewall?

Here we can see that the address 82.127.x.x has been blocked by Fail2ban because too many failed connection attempts have been made to the mysqlRoot service (this is a filter that we have added to Fail2ban and which checks connections to the MySQL service with the root user). This IP will therefore no longer be able to connect to the MySQL service, at least temporarily.


How to unblock an IP blacklisted by Fail2ban

For this step, you will need to connect via SSH(How to connect as root on a dedicated VPS server).

Once connected, use the following command:

fail2ban-client set SERVICE unbanip IP

In our example :

fail2ban-client set mysqlRoot unbanip 82.127.x.x


Go back to your ISPconfig panel, the IP has been unblacklisted:

How can I tell if my IP has been blocked by my server's firewall?

help.lws.net/a/656
Was this article helpful?

Yes

No

Read 31 469 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

RGPD : Responsable LWS-Ligne Web Services. Finalité : modération et publication publique de votre question, notification éventuelle d'une réponse. Base légale : consentement (art. 6.1.a RGPD). Conservation des emails : 90 jours après notification, 12 mois maximum sans réponse. Vous pouvez exercer vos droits via notre nos CGV - section RGPD.