mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5158] [Question]: The IP and domain routing rule is not working #3625
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3625
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @navipostgm-ops on GitHub (Jun 10, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5158
What are you trying to do?
Greetings!
I can't seem to get a routing rule to work that directs a specific range of domains and IP addresses to a separate outbound channel.
If I direct all traffic to this outbound channel, it works and the channel allows traffic to pass through. What am I doing wrong?
What have you already tried?
No response
3x-ui version
3.3.0
How did you install 3x-ui?
install.sh script
Operating system
Debian 13
Screenshots or config snippets
{
"type": "field",
"inboundTag": [
"api"
],
"outboundTag": "api"
},
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
},
{
"type": "field",
"protocol": [
"bittorrent"
],
"outboundTag": "blocked"
},
{
"type": "field",
"domain": [
"cdn-telegram.org",
"comments.app",
"contest.com",
"fragment.com",
"graph.org",
"quiz.directory",
"t.me",
"tdesktop.com",
"telega.one",
"telegra.ph",
"telegram-cdn.org",
"telegram.dog",
"telegram.me",
"telegram.org",
"telegram.space",
"telesco.pe",
"tg.dev",
"tx.me",
"usercontent.dev",
"k.telegram.org",
"web.telegram.org",
"z.telegram.org"
],
"ip": [
"91.105.192.0/23",
"91.108.4.0/22",
"91.108.8.0/22",
"91.108.12.0/22",
"91.108.16.0/22",
"91.108.20.0/22",
"91.108.56.0/22",
"91.108.58.0/23",
"95.161.64.0/20",
"149.154.160.0/20",
"149.154.162.0/23",
"149.154.164.0/23",
"149.154.166.0/23",
"149.154.168.0/22",
"149.154.172.0/22",
"185.76.151.0/24",
"188.166.0.0/16",
"104.16.0.0/12",
"172.64.0.0/10",
"188.114.96.0/22",
"3.32.0.0/15",
"13.248.128.0/18",
"44.224.0.0/15",
"52.32.0.0/12",
"151.101.0.0/16",
"49.12.0.0/14",
"95.216.0.0/15",
"15.204.0.0/15",
"35.128.0.0/10"
],
"network": "TCP,UDP",
"outboundTag": "ovpn"
}
Before submitting
@github-actions[bot] commented on GitHub (Jun 10, 2026):
Root cause: Xray-core AND logic when a rule has both domain and ip fields. When multiple condition fields appear in the same rule object, Xray-core requires ALL of them to match simultaneously. In practice this almost never triggers: a SOCKS5 or HTTP CONNECT request carries a domain name but no IP so the ip condition fails and the rule is skipped; a direct connection to a Telegram IP carries an IP but no domain so the domain condition fails and the rule is skipped. This is why routing all traffic to the outbound works fine but the combined domain+ip rule has no effect. Fix: replace the single combined rule with two rules in Xray -> Routing, both pointing to the ovpn outbound. Rule 1 has only the domain list (leave the IP field blank). Rule 2 has only the ip list (leave the Domain field blank). Xray stops at the first matching rule so a match on either is sufficient. Optional shortcut: if geodata is current on your server, use geosite:telegram for the domain rule and geoip:telegram for the IP rule instead of the long manual lists.
@navipostgm-ops commented on GitHub (Jun 10, 2026):
Yes, it worked! Thank you so much, kind person! )