[GH-ISSUE #3255] limitIp setting is ignored for VLESS inbounds using xtls-rprx-vision flow #2204

Closed
opened 2026-10-31 20:23:55 +07:00 by bsakaguchi · 7 comments
Owner

Originally created by @mysubcult on GitHub (Jul 19, 2025).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3255

Describe the bug

Hello,

I've discovered a bug where the IP limit functionality (limitIp) is not being enforced under a specific and repeatable condition. The setting is correctly saved to the database but seems to be ignored when the panel generates the final Xray config.

Bug Description:

For a VLESS inbound, if a client's flow is set to xtls-rprx-vision, the limitIp setting (e.g., set to 1) does not work. Multiple users can connect simultaneously from different IPs using the same client config. However, if the flow is changed to anything else (like xtls-rprx-direct), the limitIp function works perfectly as expected.

Additional Context & Analysis:

  • I have inspected the /etc/x-ui/x-ui.db file and can confirm that the client's configuration is correctly saved with "limitIp": 1. This strongly suggests the issue is not in saving the settings, but in the logic that generates the final running config for Xray.
  • Workaround: Changing the flow to xtls-rprx-direct immediately fixes the issue and the IP limit is enforced. However, for users in countries with active VPN blocking, xtls-rprx-vision is a critical feature for stealth, making this workaround unsuitable for many.

Thank you for your hard work on this project. I hope this report helps in resolving the issue.

How to repeat the problem?

  1. Navigate to an existing VLESS inbound or create a new one.
  2. In the client settings for that inbound, configure the following:
    • Protocol: VLESS
    • Flow: xtls-rprx-vision
    • Limit IP: 1
  3. Save the changes and restart the Xray service from the dashboard to apply the settings.
  4. Connect to this VPN configuration from a first device (Device A).
  5. While Device A is connected, connect to the same VPN configuration from a second device with a different public IP address (Device B).

Expected action

Expected Behavior:

The connection from Device B should be rejected, as the IP limit is set to 1 and is already occupied by Device A.

Received action

Actual Behavior:

Both Device A and Device B connect successfully and simultaneously. The panel's UI correctly displays two active IP addresses for the single client, confirming that the limitIp: 1 rule was ignored by the Xray core.

3x-ui Version

2.6.2

Xray-core Version

25.6.8

Checklist

  • This bug report is written entirely in English.
  • This bug report is new and no one has reported it before me.
Originally created by @mysubcult on GitHub (Jul 19, 2025). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3255 ### Describe the bug Hello, I've discovered a bug where the IP limit functionality (`limitIp`) is not being enforced under a specific and repeatable condition. The setting is correctly saved to the database but seems to be ignored when the panel generates the final Xray config. **Bug Description:** For a VLESS inbound, if a client's `flow` is set to `xtls-rprx-vision`, the `limitIp` setting (e.g., set to 1) does not work. Multiple users can connect simultaneously from different IPs using the same client config. However, if the `flow` is changed to anything else (like `xtls-rprx-direct`), the `limitIp` function works perfectly as expected. **Additional Context & Analysis:** * I have inspected the `/etc/x-ui/x-ui.db` file and can confirm that the client's configuration is correctly saved with `"limitIp": 1`. This strongly suggests the issue is not in saving the settings, but in the logic that generates the final running config for Xray. * **Workaround:** Changing the `flow` to `xtls-rprx-direct` immediately fixes the issue and the IP limit is enforced. However, for users in countries with active VPN blocking, `xtls-rprx-vision` is a critical feature for stealth, making this workaround unsuitable for many. Thank you for your hard work on this project. I hope this report helps in resolving the issue. ### How to repeat the problem? 1. Navigate to an existing VLESS inbound or create a new one. 2. In the client settings for that inbound, configure the following: * **Protocol:** `VLESS` * **Flow:** `xtls-rprx-vision` * **Limit IP:** `1` 3. Save the changes and restart the Xray service from the dashboard to apply the settings. 4. Connect to this VPN configuration from a first device (Device A). 5. While Device A is connected, connect to the same VPN configuration from a second device with a different public IP address (Device B). ### Expected action **Expected Behavior:** The connection from Device B should be rejected, as the IP limit is set to 1 and is already occupied by Device A. ### Received action **Actual Behavior:** Both Device A and Device B connect successfully and simultaneously. The panel's UI correctly displays two active IP addresses for the single client, confirming that the `limitIp: 1` rule was ignored by the Xray core. ### 3x-ui Version 2.6.2 ### Xray-core Version 25.6.8 ### Checklist - [x] This bug report is written entirely in English. - [x] This bug report is new and no one has reported it before me.
bsakaguchi 2026-10-31 20:23:55 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@datout commented on GitHub (Jul 29, 2025):

I have also noticed this problem

<!-- gh-comment-id:3130340063 --> @datout commented on GitHub (Jul 29, 2025): I have also noticed this problem
Author
Owner

@sedyh commented on GitHub (Aug 15, 2025):

+1 for this, it doesn't seem to work

<!-- gh-comment-id:3192529210 --> @sedyh commented on GitHub (Aug 15, 2025): +1 for this, it doesn't seem to work
Author
Owner

@mysubcult commented on GitHub (Aug 16, 2025):

@MHSanaei, could you look into this issue?

<!-- gh-comment-id:3193590205 --> @mysubcult commented on GitHub (Aug 16, 2025): @MHSanaei, could you look into this issue?
Author
Owner

@jifeon commented on GitHub (Sep 16, 2025):

Hi @mysubcult

Have you found any workarounds?

<!-- gh-comment-id:3300464819 --> @jifeon commented on GitHub (Sep 16, 2025): Hi @mysubcult Have you found any workarounds?
Author
Owner

@mysubcult commented on GitHub (Sep 17, 2025):

Hi @mysubcult

Have you found any workarounds?

No, I'm still waiting and I hope that this error will be fixed.

<!-- gh-comment-id:3301615079 --> @mysubcult commented on GitHub (Sep 17, 2025): > Hi [@mysubcult](https://github.com/mysubcult) > > Have you found any workarounds? No, I'm still waiting and I hope that this error will be fixed.
Author
Owner

@jifeon commented on GitHub (Sep 17, 2025):

Managed to solve it. Not ideal but working. Here’s what turned out to be the cause + my working fix. Maybe this helps

🔍 What was wrong in my case

  • My server is Debian 12 / 13 which uses iptables v1.8 with the nftables backend (iptables-nft) by default.
  • The default 3x-ipl action shipped with 3x-ui is an iptables-only action. It doesn’t operate in the nftables backend.

✅ How I fixed it

Here’s what I changed / added to make the ban actually stop both new and live connections:

  1. Created a new Fail2ban “nft” action for nftables, which drops packets.

    # in /etc/fail2ban/action.d/3x-ipl-nft.conf
    [Definition]
    # Ensure the inet table/chain exists
    actionstart = nft add table inet f2b 2>/dev/null || true
                  nft list chain inet f2b input 2>/dev/null >/dev/null || \
                  nft add chain inet f2b input { type filter hook input priority 0 \; }
    
    # Clean up
    actionstop  = nft delete table inet f2b 2>/dev/null || true
    actioncheck = nft list table inet f2b
    
    # Ban: drop both IPv4/IPv6 traffic + kill sessions + log to 3xipl-banned.log
    actionban   = nft add rule inet f2b input ip saddr <ip> drop
                  nft add rule inet f2b input ip6 saddr <ip> drop 2>/dev/null || true
                  conntrack -D -s <ip> || true
                  conntrack -D -s <ip> -f ipv6 2>/dev/null || true
                  echo "$(date +"%%Y/%%m/%%d %%H:%M:%S")   BAN   [Email]=<F-USER> [IP]=<ip> for <bantime>s" >> /var/log/3xipl-banned.log
    
    # Unban: remove rules by handle + log
    actionunban = nft delete rule inet f2b input handle $(nft -a list chain inet f2b input | awk '/saddr <ip> drop/ {print $NF}' | sort -u) 2>/dev/null || true
                  echo "$(date +"%%Y/%%m/%%d %%H:%M:%S")   UNBAN [Email]=<F-USER> [IP]=<ip>" >> /var/log/3xipl-banned.log
    
    
  2. Modify /etc/fail2ban/jail.d/3x-ipl.local to use 3x-ipl-nft action

  3. Restart fail2ban systemctl restart fail2ban

<!-- gh-comment-id:3302261461 --> @jifeon commented on GitHub (Sep 17, 2025): Managed to solve it. Not ideal but working. Here’s what turned out to be the cause + my working fix. Maybe this helps ## 🔍 What was wrong in my case * My server is Debian 12 / 13 which uses **iptables v1.8 with the nftables backend** (`iptables-nft`) by default. * The default `3x-ipl` action shipped with 3x-ui is an **iptables-only** action. It doesn’t operate in the nftables backend. ## ✅ How I fixed it Here’s what I changed / added to make the ban *actually stop* both new and live connections: 1. **Created a new Fail2ban “nft” action for nftables**, which drops packets. ```ini # in /etc/fail2ban/action.d/3x-ipl-nft.conf [Definition] # Ensure the inet table/chain exists actionstart = nft add table inet f2b 2>/dev/null || true nft list chain inet f2b input 2>/dev/null >/dev/null || \ nft add chain inet f2b input { type filter hook input priority 0 \; } # Clean up actionstop = nft delete table inet f2b 2>/dev/null || true actioncheck = nft list table inet f2b # Ban: drop both IPv4/IPv6 traffic + kill sessions + log to 3xipl-banned.log actionban = nft add rule inet f2b input ip saddr <ip> drop nft add rule inet f2b input ip6 saddr <ip> drop 2>/dev/null || true conntrack -D -s <ip> || true conntrack -D -s <ip> -f ipv6 2>/dev/null || true echo "$(date +"%%Y/%%m/%%d %%H:%M:%S") BAN [Email]=<F-USER> [IP]=<ip> for <bantime>s" >> /var/log/3xipl-banned.log # Unban: remove rules by handle + log actionunban = nft delete rule inet f2b input handle $(nft -a list chain inet f2b input | awk '/saddr <ip> drop/ {print $NF}' | sort -u) 2>/dev/null || true echo "$(date +"%%Y/%%m/%%d %%H:%M:%S") UNBAN [Email]=<F-USER> [IP]=<ip>" >> /var/log/3xipl-banned.log ``` 2. Modify /etc/fail2ban/jail.d/3x-ipl.local to use 3x-ipl-nft action 3. Restart fail2ban `systemctl restart fail2ban`
Author
Owner

@vipka1n commented on GitHub (Feb 26, 2026):

The bug is still relevant as of 26.02.2026. Please raise the priority.

<!-- gh-comment-id:3966019224 --> @vipka1n commented on GitHub (Feb 26, 2026): The bug is still relevant as of 26.02.2026. Please raise the priority.
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#2204
No description provided.