[GH-ISSUE #5527] [Question]: Conflict of fail2ban #3857

Closed
opened 2026-10-31 20:35:27 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @waltli on GitHub (Jun 24, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5527

What are you trying to do?

Regarding the changelog for version 3.4.0:
🛡️ fail2ban-native IP limiting — IP limit is now gated on fail2ban (auto-installed on install/update) and reads onlines without parsing access.log.

I have a question: If fail2ban is already installed and running normally on the host, what will happen when installing 3x-ui 3.4.0? Will the existing fail2ban conflict with the newly installed one?

What have you already tried?

No response

3x-ui version

3.4.0

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @waltli on GitHub (Jun 24, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5527 ### What are you trying to do? Regarding the changelog for version 3.4.0: 🛡️ fail2ban-native IP limiting — IP limit is now gated on fail2ban (auto-installed on install/update) and reads onlines without parsing access.log. I have a question: If fail2ban is already installed and running normally on the host, what will happen when installing 3x-ui 3.4.0? Will the existing fail2ban conflict with the newly installed one? ### What have you already tried? _No response_ ### 3x-ui version 3.4.0 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:35:27 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 24, 2026):

No conflict with an existing fail2ban installation. The installer detects fail2ban before attempting to install it, skips the package step if it is already present, and only adds 3x-ui-specific configuration files alongside whatever is already deployed.

What the installer actually does (confirmed in x-ui.sh:setup_fail2ban_iplimit() and install.sh:setup_fail2ban()):

  1. Checks whether fail2ban-client is in PATH. If it is, the package installation block is skipped entirely with the message "Fail2ban is already installed."
  2. Calls iplimit_remove_conflicts(), which only looks for a stale [3x-ipl] section inside /etc/fail2ban/jail.conf and /etc/fail2ban/jail.local and removes it. All other sections in those files are left untouched.
  3. Writes three new files that are isolated to 3x-ui's own jail:
    • /etc/fail2ban/jail.d/3x-ipl.conf
    • /etc/fail2ban/filter.d/3x-ipl.conf
    • /etc/fail2ban/action.d/3x-ipl.conf
  4. Makes two minor edits to global fail2ban config:
    • /etc/fail2ban/fail2ban.conf: uncomments allowipv6 = auto if it was commented out.
    • /etc/fail2ban/jail.conf (Ubuntu 22.04+ / Debian 12+ only): changes the first occurrence of backend = auto to backend = systemd. This is the recommended backend on those systems and should not break existing jails.
  5. Runs systemctl restart fail2ban to load the new jail alongside any pre-existing ones.

Your existing jails, filters, and actions are not modified or removed.

If you want to skip the fail2ban setup entirely (and keep the IP Limit feature disabled), set the following in /etc/default/x-ui before running the installer or update script:

XUI_ENABLE_FAIL2BAN=false

With that value set, setup_fail2ban_iplimit() exits immediately without touching fail2ban at all. The panel runtime (internal/web/service/server.go:isFail2banEnabled()) also reads this variable and, when it is set to anything other than true, reports the IP Limit feature as not usable — so the per-client limit fields are disabled in the UI.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4785782883 --> @github-actions[bot] commented on GitHub (Jun 24, 2026): No conflict with an existing fail2ban installation. The installer detects fail2ban before attempting to install it, skips the package step if it is already present, and only adds 3x-ui-specific configuration files alongside whatever is already deployed. **What the installer actually does** (confirmed in `x-ui.sh:setup_fail2ban_iplimit()` and `install.sh:setup_fail2ban()`): 1. Checks whether `fail2ban-client` is in `PATH`. If it is, the package installation block is skipped entirely with the message _"Fail2ban is already installed."_ 2. Calls `iplimit_remove_conflicts()`, which only looks for a stale `[3x-ipl]` section inside `/etc/fail2ban/jail.conf` and `/etc/fail2ban/jail.local` and removes it. All other sections in those files are left untouched. 3. Writes three new files that are isolated to 3x-ui's own jail: - `/etc/fail2ban/jail.d/3x-ipl.conf` - `/etc/fail2ban/filter.d/3x-ipl.conf` - `/etc/fail2ban/action.d/3x-ipl.conf` 4. Makes two minor edits to global fail2ban config: - `/etc/fail2ban/fail2ban.conf`: uncomments `allowipv6 = auto` if it was commented out. - `/etc/fail2ban/jail.conf` (Ubuntu 22.04+ / Debian 12+ only): changes the first occurrence of `backend = auto` to `backend = systemd`. This is the recommended backend on those systems and should not break existing jails. 5. Runs `systemctl restart fail2ban` to load the new jail alongside any pre-existing ones. Your existing jails, filters, and actions are not modified or removed. **If you want to skip the fail2ban setup entirely** (and keep the IP Limit feature disabled), set the following in `/etc/default/x-ui` before running the installer or update script: ``` XUI_ENABLE_FAIL2BAN=false ``` With that value set, `setup_fail2ban_iplimit()` exits immediately without touching fail2ban at all. The panel runtime (`internal/web/service/server.go:isFail2banEnabled()`) also reads this variable and, when it is set to anything other than `true`, reports the IP Limit feature as not usable — so the per-client limit fields are disabled in the UI. _This reply was generated automatically; a maintainer may follow up._
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3857
No description provided.