fail2ban log and unban #264

Open
opened 2026-10-05 04:08:31 +02:00 by adam · 7 comments
Owner

I'm running a znc instance as a semi-official bouncer for the engineers and developers at work, where we use an internal IRC server as our main communication method. We're running znc behind a F5 LTM hardware load balancer, and most of our users are using irssi as their client.

I'm seeing issues where all of a sudden nobody can connect to znc (current connections are OK), everyone's client gets the "ERROR :Closing link [Please try again later - reconnecting too fast]" message. My guess is that this is because of the load balancer configuration, znc sees all clients as having the same IP address.

While a reconfiguration of the load balancer is required to fix this, I'd really like 2 additions to the fail2ban module:

  1. an optional log file of every denied connection
  2. an admin command to reset the ban for a client, or remove a client from the ban list.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/973945-fail2ban-log-and-unban?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github).
I'm running a znc instance as a semi-official bouncer for the engineers and developers at work, where we use an internal IRC server as our main communication method. We're running znc behind a F5 LTM hardware load balancer, and most of our users are using irssi as their client. I'm seeing issues where all of a sudden nobody can connect to znc (current connections are OK), everyone's client gets the "ERROR :Closing link [Please try again later - reconnecting too fast]" message. My guess is that this is because of the load balancer configuration, znc sees all clients as having the same IP address. While a reconfiguration of the load balancer is required to fix this, I'd really like 2 additions to the fail2ban module: 1) an optional log file of every denied connection 2) an admin command to reset the ban for a client, or remove a client from the ban list. ## <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/973945-fail2ban-log-and-unban?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:20213325 -->
Author
Owner

So it's not beautiful, but https://github.com/znc/znc/pull/411 seems to work for the logging.

So it's not beautiful, but https://github.com/znc/znc/pull/411 seems to work for the logging. <!-- github-comment-id:25313884 -->
Author
Owner

Ok, so #411 is useless due to my lack of C++ knowledge.

Any thoughts on this, or update on #32? We're running a common ZNC instance at our company for our internal IRC network, and currently have ~45 users on the ZNC instance. When everyone is in the office and has the same source IP, and someone's client is misbehaving, fail2ban kicks everyone off. Some sort of logging (or even better, unban) is desperately needed...

Ok, so #411 is useless due to my lack of C++ knowledge. Any thoughts on this, or update on #32? We're running a common ZNC instance at our company for our internal IRC network, and currently have ~45 users on the ZNC instance. When everyone is in the office and has the same source IP, and someone's client is misbehaving, fail2ban kicks everyone off. Some sort of logging (or even better, unban) is desperately needed... <!-- github-comment-id:71633647 -->
Author
Owner

I think this is not releated to fail2ban, but "anonymous IP limit" in webadmin and increasing it to something (lot higher) might help.

I think this is not releated to fail2ban, but "anonymous IP limit" in webadmin and increasing it to something (lot higher) might help. <!-- github-comment-id:71634070 -->
Author
Owner

We've tried disabling fail2ban and it fixes it. The problem is that sometimes someone types the wrong password into their IRC client, and if their client is configured to reconnect too fast, fail2ban trips. Our office is behind NAT, so ZNC sees everyone in the office as coming from the same IP.

The more general issue is, why dosn't fail2ban log when it bans an IP, and why isn't there a way to either manually unban an IP, or to whitelist allowed IPs...

We've tried disabling fail2ban and it fixes it. The problem is that sometimes someone types the wrong password into their IRC client, and if their client is configured to reconnect too fast, fail2ban trips. Our office is behind NAT, so ZNC sees everyone in the office as coming from the same IP. The more general issue is, why dosn't fail2ban log when it bans an IP, and why isn't there a way to either manually unban an IP, or to whitelist allowed IPs... <!-- github-comment-id:71634515 -->
Author
Owner

Our office is behind NAT, so ZNC sees everyone in the office as coming from the same IP

whitelist allowed IPs

This will render fail2ban useless, you either have this only IP whitelisted, or not.

> Our office is behind NAT, so ZNC sees everyone in the office as coming from the same IP > > whitelist allowed IPs This will render fail2ban useless, you either have this only IP whitelisted, or not. <!-- github-comment-id:71743112 -->
Author
Owner

I was thinking that maybe some VPN solution between the office and ZNC could work.

I was thinking that maybe some VPN solution between the office and ZNC could work. <!-- github-comment-id:71782675 -->
Author
Owner

@DarthGandalf Sorry if I was unclear about that... our office is behind NAT. Our ZNC instance is hosted offsite, and publicly available on the Internet so that we can connect from our phones, laptops, etc. I'd be fine with whitelisting just our office IP, our real concern (why we're running fail2ban) is if anyone in the outside world happens to discover our ZNC instance.

@DarthGandalf Sorry if I was unclear about that... our _office_ is behind NAT. Our ZNC instance is hosted offsite, and publicly available on the Internet so that we can connect from our phones, laptops, etc. I'd be fine with whitelisting just our office IP, our real concern (why we're running fail2ban) is if anyone in the outside world happens to discover our ZNC instance. <!-- github-comment-id:72274092 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#264