[GH-ISSUE #3795] ip limit not work #2562

Closed
opened 2026-10-31 20:26:22 +07:00 by bsakaguchi · 22 comments
Owner

Originally created by @roozbehsat on GitHub (Feb 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3795

Describe the bug

the ip limit is not work in new version,

How to repeat the problem?

hi, the ip limit is not work in new version, also don't show the ip of client and shown [object Object]

Expected action

No response

Received action

No response

3x-ui Version

2.8.10

Xray-core Version

26.2.6

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 @roozbehsat on GitHub (Feb 13, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3795 ### Describe the bug the ip limit is not work in new version, ### How to repeat the problem? hi, the ip limit is not work in new version, also don't show the ip of client and shown [object Object] ### Expected action _No response_ ### Received action _No response_ ### 3x-ui Version 2.8.10 ### Xray-core Version 26.2.6 ### 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:26:22 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@IvanNumberOne24 commented on GitHub (Feb 13, 2026):

fixed in #3785

<!-- gh-comment-id:3895121223 --> @IvanNumberOne24 commented on GitHub (Feb 13, 2026): fixed in #3785
Author
Owner

@p4shark commented on GitHub (Feb 13, 2026):

@IvanNumberOne24 This commit only fixes the visual part of the problem, and the IP is not disconnected when the limit is exceeded with the error: WARNING - [LIMIT_IP] Failed to remove user %client%: failed to remove user: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:10085: connect: connection refused

<!-- gh-comment-id:3895194046 --> @p4shark commented on GitHub (Feb 13, 2026): @IvanNumberOne24 This commit only fixes the visual part of the problem, and the IP is not disconnected when the limit is exceeded with the error: ` WARNING - [LIMIT_IP] Failed to remove user %client%: failed to remove user: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:10085: connect: connection refused`
Author
Owner

@IvanNumberOne24 commented on GitHub (Feb 13, 2026):

@p4shark Thanks for the comment, I had difficulty translating.

A hint from Mr.D

The Xray API listens on port 62789, and the IP Limit tries to connect to 10085, which is the default of the panel.
The IP Limit is triggered and writes to the log, fail2ban reads this log and bans the IP through iptables,
but Xray itself does not disable the user because it cannot reach the API.

Temporary solution:
cp/etc/x-ui/x-ui.db /etc/x-ui/x-ui.db.bak

sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value = REPLACE(value, '"port": 62789', '"port": 10085') WHERE key = 'xrayTemplateConfig';"
sed -i 's/"port": 62789/"port": 10085/' /usr/local/x-ui/bin/config.json
systemctl restart x-ui

I hope @MHSanaei will check this decision and make adjustments.

<!-- gh-comment-id:3895562710 --> @IvanNumberOne24 commented on GitHub (Feb 13, 2026): @p4shark Thanks for the comment, I had difficulty translating. A hint from Mr.D The Xray API listens on port 62789, and the IP Limit tries to connect to 10085, which is the default of the panel. The IP Limit is triggered and writes to the log, fail2ban reads this log and bans the IP through iptables, but Xray itself does not disable the user because it cannot reach the API. Temporary solution: cp/etc/x-ui/x-ui.db /etc/x-ui/x-ui.db.bak sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value = REPLACE(value, '\"port\": 62789', '\"port\": 10085') WHERE key = 'xrayTemplateConfig';" sed -i 's/"port": 62789/"port": 10085/' /usr/local/x-ui/bin/config.json systemctl restart x-ui I hope @MHSanaei will check this decision and make adjustments.
Author
Owner

@p4shark commented on GitHub (Feb 13, 2026):

@IvanNumberOne24 I am using an online translator, sorry for the inconvenience.

I followed your steps, but for some reason the port in the specified files did not change. I changed the commands a little, but the essence remains the same, BUT it did not help.
command:
cp /etc/x-ui/x-ui.db /etc/x-ui/x-ui.db.bak
sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value = json_set(value, '$.inbounds[0].port', 10085) WHERE key = 'xrayTemplateConfig';"
manually changed the port in /usr/local/x-ui/bin/config.json
systemctl restart x-ui

The error I mentioned above is gone, but there is still no ban (the ban list is empty).

IP Limit writes the correct data about connection attempts to the log (/var/log/x-ui/3xipl.log)
2026/02/13 10:17:11 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = oneIP || Timestamp = 1770977829
2026/02/13 10:17:51 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = twoIP || Timestamp = 1770977863
2026/02/13 10:18:01 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = oneIP || Timestamp = 1770977869
2026/02/13 10:18:21 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = twoIP || Timestamp = 1770977881
2026/02/13 10:18:41 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = oneIP || Timestamp = 1770977893

The strangest thing is that I only changed the panel port (and inbounds of course); I never encountered 10085 anywhere.

<!-- gh-comment-id:3896406302 --> @p4shark commented on GitHub (Feb 13, 2026): @IvanNumberOne24 I am using an online translator, sorry for the inconvenience. I followed your steps, but for some reason the port in the specified files did not change. I changed the commands a little, but the essence remains the same, BUT it did not help. command: `cp /etc/x-ui/x-ui.db /etc/x-ui/x-ui.db.bak` `sqlite3 /etc/x-ui/x-ui.db "UPDATE settings SET value = json_set(value, '$.inbounds[0].port', 10085) WHERE key = 'xrayTemplateConfig';"` `manually changed the port in /usr/local/x-ui/bin/config.json` `systemctl restart x-ui` The error I mentioned above is gone, but there is still no ban (the ban list is empty). IP Limit writes the correct data about connection attempts to the log (/var/log/x-ui/3xipl.log) `2026/02/13 10:17:11 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = oneIP || Timestamp = 1770977829` `2026/02/13 10:17:51 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = twoIP || Timestamp = 1770977863` `2026/02/13 10:18:01 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = oneIP || Timestamp = 1770977869` `2026/02/13 10:18:21 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = twoIP || Timestamp = 1770977881` `2026/02/13 10:18:41 [LIMIT_IP] Email = p4shark || Disconnecting OLD IP = oneIP || Timestamp = 1770977893` The strangest thing is that I only changed the panel port (and inbounds of course); I never encountered 10085 anywhere.
Author
Owner

@IvanNumberOne24 commented on GitHub (Feb 13, 2026):

Then it remains to wait for a solution from more advanced users.

<!-- gh-comment-id:3896707549 --> @IvanNumberOne24 commented on GitHub (Feb 13, 2026): Then it remains to wait for a solution from more advanced users.
Author
Owner

@p4shark commented on GitHub (Feb 13, 2026):

As a temporary solution, you can roll back to version 2.8.9, comment out all lines with sort in the /web/job/check_client_ip_job.go , and rebuild the project for your OS.
Then, after the limit is exceeded, the first connected IP will be blocked.
FIFB (First In First Banned) (haha, sorry, bad joke)

<!-- gh-comment-id:3897082472 --> @p4shark commented on GitHub (Feb 13, 2026): As a temporary solution, you can roll back to version 2.8.9, comment out all lines with sort in the `/web/job/check_client_ip_job.go `, and rebuild the project for your OS. Then, after the limit is exceeded, the first connected IP will be blocked. _FIFB (First In First Banned) (haha, sorry, bad joke)_
Author
Owner

@p4shark commented on GitHub (Feb 14, 2026):

Hmm, maybe @AungYeZawDev help us?

<!-- gh-comment-id:3901283592 --> @p4shark commented on GitHub (Feb 14, 2026): Hmm, maybe @AungYeZawDev help us?
Author
Owner

@AungYeZawDev commented on GitHub (Feb 14, 2026):

Hi @p4shark , thanks for tagging me.

This issue is likely caused by the data structure change in my previous PR (#3735). I modified the stored IP format to include timestamps (to support the 'last IP wins' logic), but it seems the frontend display logic interprets it as an object instead of extracting the IP string.

I will investigate the code and submit a fix for this ASAP.

<!-- gh-comment-id:3901307247 --> @AungYeZawDev commented on GitHub (Feb 14, 2026): Hi @p4shark , thanks for tagging me. This issue is likely caused by the data structure change in my previous PR (#3735). I modified the stored IP format to include timestamps (to support the 'last IP wins' logic), but it seems the frontend display logic interprets it as an object instead of extracting the IP string. I will investigate the code and submit a fix for this ASAP.
Author
Owner

@akhxp commented on GitHub (Feb 16, 2026):

I think you should change this line in /etc/fail2ban/filter.d/3x-ipl.conf :

old :
failregex = \[LIMIT_IP\]\s*Email\s*=\s*<F-USER>.+</F-USER>\s*\|\|\s*SRC\s*=\s*<ADDR>
new :
failregex = \[LIMIT_IP\]\s*Email\s*=\s*<F-USER>.+</F-USER>\s*\|\|\s*Disconnecting\s*OLD\s*IP\s*=\s*<ADDR>

<!-- gh-comment-id:3906200984 --> @akhxp commented on GitHub (Feb 16, 2026): I think you should change this line in /etc/fail2ban/filter.d/3x-ipl.conf : old : `failregex = \[LIMIT_IP\]\s*Email\s*=\s*<F-USER>.+</F-USER>\s*\|\|\s*SRC\s*=\s*<ADDR>` new : `failregex = \[LIMIT_IP\]\s*Email\s*=\s*<F-USER>.+</F-USER>\s*\|\|\s*Disconnecting\s*OLD\s*IP\s*=\s*<ADDR>`
Author
Owner

@JacksonSwich commented on GitHub (Feb 19, 2026):

Hello everybody! The comment was made with the help of a translator, so I apologize in advance.

I have been observing the problem with Limit_IP since the release of the latest version and have been waiting for the problem to be resolved.
Now, after installing the new version 2.8.10, the problem has not been resolved yet. I completely ran into the same thing as @p4shark .
I solved the problem with listening to the wrong portal by changing the configuration of XRay. I changed the port to the required one, as mentioned above. After that, this warning disappeared: WARNING - [LIMIT_IP] Couldn't delete user %client%: couldn't delete user: rpc error: code = unavailable Description = connection error: description= "Transport: Error when dialing: dial tcp 127.0.0.1:10085: connect: Connection denied.

Well, as you indicated, the ip address remains unblocked, although the logs say otherwise.:
2026/02/19 18:07:11 [LIMIT_IP] Email = test || Disabling OLD IP = ip || Timestamp = 1770977829

I found a lot of topics on this issue on github. But still, I would like to clarify the status of the solution to this problem.

<!-- gh-comment-id:3927918554 --> @JacksonSwich commented on GitHub (Feb 19, 2026): Hello everybody! The comment was made with the help of a translator, so I apologize in advance. I have been observing the problem with Limit_IP since the release of the latest version and have been waiting for the problem to be resolved. Now, after installing the new version 2.8.10, the problem has not been resolved yet. I completely ran into the same thing as @p4shark . I solved the problem with listening to the wrong portal by changing the configuration of XRay. I changed the port to the required one, as mentioned above. After that, this warning disappeared: `WARNING - [LIMIT_IP] Couldn't delete user %client%: couldn't delete user: rpc error: code = unavailable Description = connection error: description= "Transport: Error when dialing: dial tcp 127.0.0.1:10085: connect: Connection denied.` Well, as you indicated, the ip address remains unblocked, although the logs say otherwise.: `2026/02/19 18:07:11 [LIMIT_IP] Email = test || Disabling OLD IP = ip || Timestamp = 1770977829` I found a lot of topics on this issue on github. But still, I would like to clarify the status of the solution to this problem.
Author
Owner

@MHSanaei commented on GitHub (Feb 20, 2026):

try this version
https://github.com/MHSanaei/3x-ui/actions/runs/22045725105

<!-- gh-comment-id:3933817719 --> @MHSanaei commented on GitHub (Feb 20, 2026): try this version https://github.com/MHSanaei/3x-ui/actions/runs/22045725105
Author
Owner

@almen2006 commented on GitHub (Feb 21, 2026):

After the update, users lost their ip limit choice.

<!-- gh-comment-id:3937956219 --> @almen2006 commented on GitHub (Feb 21, 2026): After the update, users lost their ip limit choice.
Author
Owner

@GmeX1 commented on GitHub (Feb 22, 2026):

try this version https://github.com/MHSanaei/3x-ui/actions/runs/22045725105

Now IPs are being displayed correctly in the panel, BUT the ban doesn't work. Tested with 2 different IPs and IP Limit set to 1, both of them work perfectly

<!-- gh-comment-id:3940884993 --> @GmeX1 commented on GitHub (Feb 22, 2026): > try this version https://github.com/MHSanaei/3x-ui/actions/runs/22045725105 Now IPs are being displayed correctly in the panel, BUT the ban doesn't work. Tested with 2 different IPs and IP Limit set to 1, both of them work perfectly
Author
Owner

@ermilov-dmitry commented on GitHub (Mar 3, 2026):

Hi thread! Any success fighting this bug? Is there a way to limit the use of the issued configs?

<!-- gh-comment-id:3991355131 --> @ermilov-dmitry commented on GitHub (Mar 3, 2026): Hi thread! Any success fighting this bug? Is there a way to limit the use of the issued configs?
Author
Owner

@ermilov-dmitry commented on GitHub (Mar 9, 2026):

@MHSanaei Hello! How is this issue closed? The "IP Limit" feature still doesn't work.

I've just tested on the fresh 2.8.11:

  • 2 devices, 2 IPs (cell and landline ISP).
  • single inbound config for both devices, IP Limit set to 1.

Expected:
First device connects, all good.
Second device connects (another IP), first device (Initial IP) drops connection.
Is that correct expected behavior?

What happens:

  1. BOTH devices establish and maintain connection with the single Inbound config where IP limit set to 1.
  2. The only improvement from previous version is that IP address is correctly parsed and shown in IP Log. It also seems to show only one last connected IP (IP limit = 1).

Could you please take a deeper look into this issue? It's a core functionality that prevents abuse from the clients. It's impossible now to limit the use.
Thank you for your time and effort!

<!-- gh-comment-id:4023033001 --> @ermilov-dmitry commented on GitHub (Mar 9, 2026): @MHSanaei Hello! How is this issue closed? The "IP Limit" feature still doesn't work. I've just tested on the fresh 2.8.11: - 2 devices, 2 IPs (cell and landline ISP). - single inbound config for both devices, IP Limit set to 1. Expected: First device connects, all good. Second device connects (another IP), first device (Initial IP) drops connection. _Is that correct expected behavior?_ What happens: 1. BOTH devices establish and maintain connection with the single Inbound config where IP limit set to 1. 2. The only improvement from previous version is that IP address is correctly parsed and shown in IP Log. It also seems to show only one last connected IP (IP limit = 1). Could you please take a deeper look into this issue? It's a core functionality that prevents abuse from the clients. It's impossible now to limit the use. Thank you for your time and effort!
Author
Owner

@steppash commented on GitHub (Mar 10, 2026):

We need to open a new issue. This must be one of the basic functions that should work as intended. @MHSanaei, thanks.

<!-- gh-comment-id:4030888875 --> @steppash commented on GitHub (Mar 10, 2026): We need to open a new issue. This must be one of the basic functions that should work as intended. @MHSanaei, thanks.
Author
Owner

@MHSanaei commented on GitHub (Mar 10, 2026):

@steppash everything should works on the last update
U need to reinstall fail2ban for it

<!-- gh-comment-id:4030906286 --> @MHSanaei commented on GitHub (Mar 10, 2026): @steppash everything should works on the last update U need to reinstall fail2ban for it
Author
Owner

@steppash commented on GitHub (Mar 10, 2026):

@MHSanaei I did this. The fail2ban logs are clean, but the session for the first of the two IP addresses isn't disconnected, apparently blocking occurs at the TCP connection level. Both clients quickly try to reconnect, thereby ensuring that the traffic from their IP addresses is loaded onto the same client. Perhaps I'm misunderstanding how fail2ban works, but I think it's simply a quirk of the Xray architecture.

<!-- gh-comment-id:4030953565 --> @steppash commented on GitHub (Mar 10, 2026): @MHSanaei I did this. The fail2ban logs are clean, but the session for the first of the two IP addresses isn't disconnected, apparently blocking occurs at the TCP connection level. Both clients quickly try to reconnect, thereby ensuring that the traffic from their IP addresses is loaded onto the same client. Perhaps I'm misunderstanding how fail2ban works, but I think it's simply a quirk of the Xray architecture.
Author
Owner

@ermilov-dmitry commented on GitHub (Mar 10, 2026):

@MHSanaei thanks for clarification! I does seem to work for me now, after I've re-installed fail2ban.

<!-- gh-comment-id:4030973702 --> @ermilov-dmitry commented on GitHub (Mar 10, 2026): @MHSanaei thanks for clarification! I does seem to work for me now, after I've re-installed fail2ban.
Author
Owner

@ermilov-dmitry commented on GitHub (Mar 10, 2026):

@steppash what do you have set for IP limit?
Try a clean experiment after refreshing the whole system: reboot, re-install fail2ban. Ensure the settings are correct and at least 2 IPs are at play.

<!-- gh-comment-id:4030981400 --> @ermilov-dmitry commented on GitHub (Mar 10, 2026): @steppash what do you have set for IP limit? Try a clean experiment after refreshing the whole system: reboot, re-install fail2ban. Ensure the settings are correct and at least 2 IPs are at play.
Author
Owner

@ermilov-dmitry commented on GitHub (Mar 10, 2026):

Although I'm getting this weird warning after i've set the IP limit to 2 (my baseline conifg).

WARNING - X-UI: [LIMIT_IP] Failed to remove user [REDACTED]: failed to remove user: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:10085: connect: connection refused"

<!-- gh-comment-id:4031012219 --> @ermilov-dmitry commented on GitHub (Mar 10, 2026): Although I'm getting this weird warning after i've set the IP limit to 2 (my baseline conifg). `WARNING - X-UI: [LIMIT_IP] Failed to remove user [REDACTED]: failed to remove user: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:10085: connect: connection refused" `
Author
Owner

@ermilov-dmitry commented on GitHub (Mar 10, 2026):

Should I have the port 10085 open?

<!-- gh-comment-id:4031016365 --> @ermilov-dmitry commented on GitHub (Mar 10, 2026): Should I have the port 10085 open?
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#2562
No description provided.