[GH-ISSUE #1212] IP limit really doesn't work #829

Closed
opened 2026-10-31 20:14:43 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @likstanov on GitHub (Nov 10, 2023).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/1212

Welcome

  • Yes, I'm using the latest major release. Only such installations are supported.
  • Yes, I'm using the supported system. Only such systems are supported.
  • Yes, I have read all WIKI document,nothing can help me in my problem.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, log, etc).

Description of the problem,screencshot would be good

Hi there. I've red many issues from another users about IP limit problem and I can confirm that. I installed 3x-ui via author's script (without docker), I installed "fail2ban", I also edited log in "x-ray" config as author recommended: https://github.com/MHSanaei/3x-ui/issues/1138#issuecomment-1768685978. IP limit doesn't work.
I have logs like that:
2023/11/10 14:51:51 DEBUG - disAllowedIps [95.95.95.95] // I replaced IP.
In admin panel in client info (IP log) I also see 2 ip's, although I set limit for 1 IP. Limit doesn't work. For some reason, the author closes the issues about IP limit as solved, although that problem is actual.
The author, please help us solve this problem 🫶

Version of 3x-ui

1.7.9

x-ui log reports or xray log

2023/11/10 14:51:51 DEBUG - disAllowedIps [95.95.95.95]
Originally created by @likstanov on GitHub (Nov 10, 2023). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/1212 ### Welcome - [X] Yes, I'm using the latest major release. Only such installations are supported. - [X] Yes, I'm using the supported system. Only such systems are supported. - [X] Yes, I have read all WIKI document,nothing can help me in my problem. - [X] Yes, I've searched similar issues on GitHub and didn't find any. - [X] Yes, I've included all information below (version, config, log, etc). ### Description of the problem,screencshot would be good Hi there. I've red many issues from another users about IP limit problem and I can confirm that. I installed 3x-ui via author's script (without docker), I installed "fail2ban", I also edited log in "x-ray" config as author recommended: https://github.com/MHSanaei/3x-ui/issues/1138#issuecomment-1768685978. IP limit doesn't work. I have logs like that: `2023/11/10 14:51:51 DEBUG - disAllowedIps [95.95.95.95]` _// I replaced IP._ In admin panel in client info (IP log) I also see 2 ip's, although I set limit for 1 IP. Limit doesn't work. For some reason, the author closes the issues about IP limit as solved, although that problem is actual. **The author, please help us solve this problem 🫶** ### Version of 3x-ui <details> ```console 1.7.9 ``` </details> ### x-ui log reports or xray log <details> ```console 2023/11/10 14:51:51 DEBUG - disAllowedIps [95.95.95.95] ``` </details>
Author
Owner

@pr381s commented on GitHub (Nov 13, 2023):

I can confirm all of that

<!-- gh-comment-id:1807596548 --> @pr381s commented on GitHub (Nov 13, 2023): I can confirm all of that
Author
Owner

@somebodywashere commented on GitHub (Nov 13, 2023):

All that you write above is not an evidance that it doesn't work. Please check the fail2ban.log in your OS logs' folder.

<!-- gh-comment-id:1807964669 --> @somebodywashere commented on GitHub (Nov 13, 2023): All that you write above is not an evidance that it doesn't work. Please check the fail2ban.log in your OS logs' folder.
Author
Owner

@sadjad1011001 commented on GitHub (Dec 13, 2023):

2023-12-13 14:07:33,191 fail2ban.utils [93304]: ERROR 7f03e1b66ca8 -- stderr: '/bin/sh: iptables: No such file or directory'
2023-12-13 14:07:33,191 fail2ban.utils [93304]: ERROR 7f03e1b66ca8 -- stderr: "/bin/sh: -c: line 1: syntax error near unexpected token newline'" 2023-12-13 14:07:33,191 fail2ban.utils [93304]: ERROR 7f03e1b66ca8 -- stderr: "/bin/sh: -c: line 1: -A f2b-3x-ipl -j '"
2023-12-13 14:07:33,191 fail2ban.utils [93304]: ERROR 7f03e1b66ca8 -- returned 1
2023-12-13 14:07:33,192 fail2ban.actions [93304]: ERROR Failed to execute ban jail '3x-ipl' action '3x-ipl' info 'ActionInfo({'ip': '5.160.101.50', 'family': 'inet4', 'fid': <function Actions.ActionInfo. at 0x7f03e1bf3158>, 'bantime': 600, 'F-': {'matches': [('', '2023/12/13 14:06:13', ' [LIMIT_IP] Email = Ali || SRC = 5.160.101.50'), '2023/12/13 14:06:53 [LIMIT_IP] Email = Ali || SRC = 5.160.101.50', '2023/12/13 14:07:23 [LIMIT_IP] Email = Ali || SRC = 5.160.101.50', '2023/12/13 14:07:33 [LIMIT_IP] Email = Ali || SRC = 5.160.101.50'], 'failures': 4, 'user': 'Ali ', 'ip4': '5.160.101.50'}, 'raw-ticket': <function Actions.ActionInfo. at 0x7f03e1bf37b8>})': Error starting action Jail('3x-ipl')/3x-ipl: 'Script error'
2023-12-13 14:07:43,124 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:07:43
2023-12-13 14:08:13,158 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:08:13
2023-12-13 14:08:33,182 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:08:33
2023-12-13 14:08:43,193 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:08:43
2023-12-13 14:09:03,217 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:09:03
2023-12-13 14:09:53,274 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:09:53
2023-12-13 14:10:03,286 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:10:03
2023-12-13 14:10:03,286 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:10:03
2023-12-13 14:10:03,353 fail2ban.actions [93304]: WARNING [3x-ipl] 5.160.101.50 already banned
2023-12-13 14:10:33,319 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:10:33
2023-12-13 14:10:33,319 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:10:33
2023-12-13 14:10:53,343 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:10:53
2023-12-13 14:10:53,343 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:10:53
2023-12-13 14:11:03,355 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:11:03
2023-12-13 14:11:03,356 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:11:03
2023-12-13 14:11:03,417 fail2ban.actions [93304]: NOTICE [3x-ipl] Ban 5.113.98.200
2023-12-13 14:11:03,422 fail2ban.utils [93304]: ERROR 7f03e1bed8a0 -- exec: -I f2b-3x-ipl 1 -s 5.113.98.200 -j
echo "$(date +"%Y/%m/%d %H:%M:%S") BAN [Email] = Ali [IP] = 5.113.98.200 banned for 600 seconds." >> /var/log/3xipl-banned.log
2023-12-13 14:11:03,422 fail2ban.utils [93304]: ERROR 7f03e1bed8a0 -- stderr: "/bin/sh: -c: line 0: syntax error near unexpected token newline'" 2023-12-13 14:11:03,422 fail2ban.utils [93304]: ERROR 7f03e1bed8a0 -- stderr: "/bin/sh: -c: line 0: -I f2b-3x-ipl 1 -s 5.113.98.200 -j '"
2023-12-13 14:11:03,422 fail2ban.utils [93304]: ERROR 7f03e1bed8a0 -- returned 1
2023-12-13 14:11:03,426 fail2ban.utils [93304]: ERROR 7f03e1bcf988 -- exec: -n -L | grep -q 'f2b-3x-ipl[ \t]'
2023-12-13 14:11:03,426 fail2ban.utils [93304]: ERROR 7f03e1bcf988 -- stderr: "/bin/sh: -c: line 0: syntax error near unexpected token |'" 2023-12-13 14:11:03,427 fail2ban.utils [93304]: ERROR 7f03e1bcf988 -- stderr: "/bin/sh: -c: line 0: -n -L | grep -q 'f2b-3x-ipl[ \t]''"
2023-12-13 14:11:03,427 fail2ban.utils [93304]: ERROR 7f03e1bcf988 -- returned 1
2023-12-13 14:11:03,427 fail2ban.CommandAction [93304]: ERROR Invariant check failed. Trying to restore a sane environment
2023-12-13 14:11:03,431 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- exec: -N f2b-3x-ipl
-A f2b-3x-ipl -j
-I -p -j f2b-3x-ipl
2023-12-13 14:11:03,432 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- stderr: '/bin/sh: iptables: No such file or directory'
2023-12-13 14:11:03,432 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- stderr: "/bin/sh: -c: line 1: syntax error near unexpected token newline'" 2023-12-13 14:11:03,432 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- stderr: "/bin/sh: -c: line 1: -A f2b-3x-ipl -j '"
2023-12-13 14:11:03,432 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- returned 1
2023-12-13 14:11:03,432 fail2ban.actions [93304]: ERROR Failed to execute ban jail '3x-ipl' action '3x-ipl' info 'ActionInfo({'ip': '5.113.98.200', 'family': 'inet4', 'fid': <function Actions.ActionInfo. at 0x7f03e1bf3158>, 'bantime': 600, 'F-
': {'matches': [('', '2023/12/13 14:10:03', ' [LIMIT_IP] Email = Ali || SRC = 5.113.98.200'), '2023/12/13 14:10:33 [LIMIT_IP] Email = Ali || SRC = 5.113.98.200', '2023/12/13 14:10:53 [LIMIT_IP] Email = Ali || SRC = 5.113.98.200', '2023/12/13 14:11:03 [LIMIT_IP] Email = Ali || SRC = 5.113.98.200'], 'failures': 4, 'user': 'Ali ', 'ip4': '5.113.98.200'}, 'raw-ticket': <function Actions.ActionInfo. at 0x7f03e1bf37b8>})': Error starting action Jail('3x-ipl')/3x-ipl: 'Script error'
2023-12-13 14:12:03,423 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:12:03
2023-12-13 14:12:23,447 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:12:23
2023-12-13 14:13:13,504 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:13:13
2023-12-13 14:14:33,595 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:14:33

<!-- gh-comment-id:1854001545 --> @sadjad1011001 commented on GitHub (Dec 13, 2023): 2023-12-13 14:07:33,191 fail2ban.utils [93304]: ERROR 7f03e1b66ca8 -- stderr: '/bin/sh: iptables: No such file or directory' 2023-12-13 14:07:33,191 fail2ban.utils [93304]: ERROR 7f03e1b66ca8 -- stderr: "/bin/sh: -c: line 1: syntax error near unexpected token `newline'" 2023-12-13 14:07:33,191 fail2ban.utils [93304]: ERROR 7f03e1b66ca8 -- stderr: "/bin/sh: -c: line 1: `<iptables> -A f2b-3x-ipl -j <returntype>'" 2023-12-13 14:07:33,191 fail2ban.utils [93304]: ERROR 7f03e1b66ca8 -- returned 1 2023-12-13 14:07:33,192 fail2ban.actions [93304]: ERROR Failed to execute ban jail '3x-ipl' action '3x-ipl' info 'ActionInfo({'ip': '5.160.101.50', 'family': 'inet4', 'fid': <function Actions.ActionInfo.<lambda> at 0x7f03e1bf3158>, 'bantime': 600, 'F-*': {'matches': [('', '2023/12/13 14:06:13', ' [LIMIT_IP] Email = Ali || SRC = 5.160.101.50'), '2023/12/13 14:06:53 [LIMIT_IP] Email = Ali || SRC = 5.160.101.50', '2023/12/13 14:07:23 [LIMIT_IP] Email = Ali || SRC = 5.160.101.50', '2023/12/13 14:07:33 [LIMIT_IP] Email = Ali || SRC = 5.160.101.50'], 'failures': 4, 'user': 'Ali ', 'ip4': '5.160.101.50'}, 'raw-ticket': <function Actions.ActionInfo.<lambda> at 0x7f03e1bf37b8>})': Error starting action Jail('3x-ipl')/3x-ipl: 'Script error' 2023-12-13 14:07:43,124 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:07:43 2023-12-13 14:08:13,158 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:08:13 2023-12-13 14:08:33,182 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:08:33 2023-12-13 14:08:43,193 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:08:43 2023-12-13 14:09:03,217 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:09:03 2023-12-13 14:09:53,274 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:09:53 2023-12-13 14:10:03,286 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:10:03 2023-12-13 14:10:03,286 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:10:03 2023-12-13 14:10:03,353 fail2ban.actions [93304]: WARNING [3x-ipl] 5.160.101.50 already banned 2023-12-13 14:10:33,319 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:10:33 2023-12-13 14:10:33,319 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:10:33 2023-12-13 14:10:53,343 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:10:53 2023-12-13 14:10:53,343 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:10:53 2023-12-13 14:11:03,355 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:11:03 2023-12-13 14:11:03,356 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:11:03 2023-12-13 14:11:03,417 fail2ban.actions [93304]: NOTICE [3x-ipl] Ban 5.113.98.200 2023-12-13 14:11:03,422 fail2ban.utils [93304]: ERROR 7f03e1bed8a0 -- exec: <iptables> -I f2b-3x-ipl 1 -s 5.113.98.200 -j <blocktype> echo "$(date +"%Y/%m/%d %H:%M:%S") BAN [Email] = Ali [IP] = 5.113.98.200 banned for 600 seconds." >> /var/log/3xipl-banned.log 2023-12-13 14:11:03,422 fail2ban.utils [93304]: ERROR 7f03e1bed8a0 -- stderr: "/bin/sh: -c: line 0: syntax error near unexpected token `newline'" 2023-12-13 14:11:03,422 fail2ban.utils [93304]: ERROR 7f03e1bed8a0 -- stderr: "/bin/sh: -c: line 0: `<iptables> -I f2b-3x-ipl 1 -s 5.113.98.200 -j <blocktype>'" 2023-12-13 14:11:03,422 fail2ban.utils [93304]: ERROR 7f03e1bed8a0 -- returned 1 2023-12-13 14:11:03,426 fail2ban.utils [93304]: ERROR 7f03e1bcf988 -- exec: <iptables> -n -L <chain> | grep -q 'f2b-3x-ipl[ \t]' 2023-12-13 14:11:03,426 fail2ban.utils [93304]: ERROR 7f03e1bcf988 -- stderr: "/bin/sh: -c: line 0: syntax error near unexpected token `|'" 2023-12-13 14:11:03,427 fail2ban.utils [93304]: ERROR 7f03e1bcf988 -- stderr: "/bin/sh: -c: line 0: `<iptables> -n -L <chain> | grep -q 'f2b-3x-ipl[ \\t]''" 2023-12-13 14:11:03,427 fail2ban.utils [93304]: ERROR 7f03e1bcf988 -- returned 1 2023-12-13 14:11:03,427 fail2ban.CommandAction [93304]: ERROR Invariant check failed. Trying to restore a sane environment 2023-12-13 14:11:03,431 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- exec: <iptables> -N f2b-3x-ipl <iptables> -A f2b-3x-ipl -j <returntype> <iptables> -I <chain> -p <protocol> -j f2b-3x-ipl 2023-12-13 14:11:03,432 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- stderr: '/bin/sh: iptables: No such file or directory' 2023-12-13 14:11:03,432 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- stderr: "/bin/sh: -c: line 1: syntax error near unexpected token `newline'" 2023-12-13 14:11:03,432 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- stderr: "/bin/sh: -c: line 1: `<iptables> -A f2b-3x-ipl -j <returntype>'" 2023-12-13 14:11:03,432 fail2ban.utils [93304]: ERROR 7f03e1b87ab0 -- returned 1 2023-12-13 14:11:03,432 fail2ban.actions [93304]: ERROR Failed to execute ban jail '3x-ipl' action '3x-ipl' info 'ActionInfo({'ip': '5.113.98.200', 'family': 'inet4', 'fid': <function Actions.ActionInfo.<lambda> at 0x7f03e1bf3158>, 'bantime': 600, 'F-*': {'matches': [('', '2023/12/13 14:10:03', ' [LIMIT_IP] Email = Ali || SRC = 5.113.98.200'), '2023/12/13 14:10:33 [LIMIT_IP] Email = Ali || SRC = 5.113.98.200', '2023/12/13 14:10:53 [LIMIT_IP] Email = Ali || SRC = 5.113.98.200', '2023/12/13 14:11:03 [LIMIT_IP] Email = Ali || SRC = 5.113.98.200'], 'failures': 4, 'user': 'Ali ', 'ip4': '5.113.98.200'}, 'raw-ticket': <function Actions.ActionInfo.<lambda> at 0x7f03e1bf37b8>})': Error starting action Jail('3x-ipl')/3x-ipl: 'Script error' 2023-12-13 14:12:03,423 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:12:03 2023-12-13 14:12:23,447 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:12:23 2023-12-13 14:13:13,504 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.113.98.200 - 2023-12-13 14:13:13 2023-12-13 14:14:33,595 fail2ban.filter [93304]: INFO [3x-ipl] Found 5.160.101.50 - 2023-12-13 14:14:33
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#829
No description provided.