mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #6842] [Question]: I am experiencing an issue with Dokodemo-door (Tunnel protocol) in the latest 3x-ui / Xray-core versions. #4552
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#4552
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 @hossein404 on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6842
What are you trying to do?
I have a working reverse WireGuard tunnel between two servers, and I want to forward incoming TCP/UDP traffic through a 3x-ui Tunnel inbound to a private IP address reachable over WireGuard.
The WireGuard connection is established and the private network is reachable. However, the Xray Tunnel inbound accepts incoming TCP connections but does not appear to forward the application traffic to the specified private destination.
This configuration is intended to work as a simple TCP/UDP port forward over an existing WireGuard connection.
Environment
Component| Version / Details
OS| Ubuntu 24.04 LTS
Kernel| 6.8.0-31-generic
3x-ui| 3.10.x
Xray-core| 26.10.10
Inbound protocol| "tunnel" (Dokodemo-door)
Network| TCP / UDP
Destination| Private IP over reverse WireGuard
Network topology
External Client
|
| TCP connection
v
Public Server (3x-ui / Xray)
213.177.178.46:1280
|
| Dokodemo-door / Tunnel inbound
v
Reverse WireGuard Connection
|
v
Private WireGuard IP
10.60.1.2:2334
|
v
Destination Service
The expected behavior is to forward incoming connections on port "1280" to "10.60.1.2:2334".
Actual inbound configuration
This configuration is present in the 3x-ui database and also appears in Xray's generated configuration:
{
"protocol": "tunnel",
"port": 1280,
"settings": {
"rewriteAddress": "10.60.1.2",
"rewritePort": 2334,
"portMap": {},
"allowedNetwork": "tcp,udp",
"followRedirect": false
}
}
The inbound is enabled.
I also have another Tunnel inbound targeting the same private destination:
{
"protocol": "tunnel",
"port": 2334,
"settings": {
"rewriteAddress": "10.60.1.2",
"rewritePort": 2334,
"portMap": {},
"allowedNetwork": "tcp,udp",
"followRedirect": true
}
}
Observed behavior
tcpdump evidence
Capture command:
tcpdump -i any -nn -s 96
'tcp port 1280 or (host 10.60.1.2 and tcp port 2334)'
Relevant output:
216.147.121.19:61618 > 213.177.178.46:1280 [S]
213.177.178.46:1280 > 216.147.121.19:61618 [S.]
216.147.121.19:61618 > 213.177.178.46:1280 [.]
216.147.121.19:61618 > 213.177.178.46:1280 [P.] length 592
213.177.178.46:1280 > 216.147.121.19:61618 [.] ack 593
216.147.121.19:61618 > 213.177.178.46:1280 [F.]
213.177.178.46:1280 > 216.147.121.19:61618 [F.]
The incoming connection and payload are acknowledged, but the client receives no application response.
The excerpt does not establish whether Xray attempted forwarding through a different routing path.
Expected behavior
Xray should forward incoming TCP/UDP connections to the configured private destination "10.60.1.2:2334", provided that the destination is reachable through the server's WireGuard interface and is not explicitly blocked by routing rules.
Steps to reproduce
Questions for maintainers
I would appreciate clarification on whether this is a bug or whether an additional routing configuration is required in newer Xray-core versions.
I can provide additional routing configuration, Xray logs, WireGuard route information, and packet captures if needed.
What have you already tried?
No response
3x-ui version
3.10.2
How did you install 3x-ui?
install.sh script
Operating system
No response
Screenshots or config snippets
No response
Before submitting
@MHSanaei commented on GitHub (Oct 16, 2026):
@claude analyze
@github-actions[bot] commented on GitHub (Oct 16, 2026):
This is not a bug. Forwarding a Tunnel inbound to a private (RFC1918) address works. It fails here because 3x-ui's default Xray template blocks every private destination twice: once in routing and again inside the
directfreedom outbound.10.60.1.2is in10.0.0.0/8, so Xray accepts the client, matches the destination asgeoip:privateand sends the connection to theblockedblackhole. That fits your capture: the handshake completes, the payload is ACKed, and no packet ever goes to10.60.1.2:2334.Answers to your questions
apiinbound is a Tunnel inbound pointed at127.0.0.1(internal/web/service/config.json:11-18).finalRulesblock it? Yes. This is the second block, described below.geoip:privaterouting rule apply to Tunnel inbounds? Yes. It has noinboundTag, so it matches traffic from every inbound.rewriteAddress/rewritePort/allowedNetwork? No. Your generated config already uses the new field names, and the panel's own template uses them too (config.json:16).Why the traffic is blocked
Default template,
internal/web/service/config.json:Even when routing sends the traffic to
direct, the freedom outbound refuses private targets (config.json:31-40):This is deliberate anti-SSRF hardening. It was added after #6037 in
892c06c8("Bug-label issue sweep: 16 fixes (#6083)"), first released in v3.6.0. The same commit also added a one-time migration,hardenFreedomFinalRules/rewriteFreedomFinalRulesPrivateEgress(internal/database/db.go:2696-2768). On upgrade it rewrote existingdirectoutbounds that had empty, allow-only or the older allow-geoip:private-onlyfinalRulesto the block-then-allow pair above. So an older install that once forwarded to private IPs will also stop doing so after upgrading.Fix (Xray Configs in the panel)
directin place for all other traffic: You can widen the allowed range to your WireGuard subnet (for example10.60.1.0/24) if you need more hosts.geoip:private→blockedrule. Rules are first-match-wins, as described indocs/content/docs/en/operations/outbounds-routing.mdx:139: Copy the tag exactly as the Inbounds list shows it. The panel generates tags of the formin-<port>-<transport>.-> blockedvs-> wg-lan). After that it is a host routing problem: checkip route get 10.60.1.2on the panel server.Note: your second inbound on port 2334 has
followRedirect: true. With that flag, Xray uses the original destination recovered from an iptables REDIRECT/TPROXY rule instead ofrewriteAddress. It is not involved in the port 1280 path, and you don't need it for a plain port forward.Verdict: Not a bug (user configuration)
Severity: N/A
Confidence: High for the two blocking rules, Medium that they are what dropped your connection (inferred; your Xray access log and full routing config are not in the report)
Root cause: The default template routes
geoip:privateto theblockedblackhole (internal/web/service/config.json:70-76), and thedirectfreedom outbound blocksgeoip:privateinfinalRules(config.json:34-35). Both are intentional anti-SSRF defaults from892c06c8(v3.6.0).Same class: None found
Already fixed: Not applicable
Duplicate of: Related: #6037 (origin of the hardening), #6669 (same default blocking LAN access)
Evidence:
config.json:35{ "action": "block", "ip": ["geoip:private"] };config.json:71-74"ip": ["geoip:private"], "outboundTag": "blocked";internal/database/db.go:2754-2757migration writing the same block rule into existing templatesNot determined: Whether your live template still has these rules unchanged. The access log line for one test connection (
-> blocked) would confirm it.This reply was generated automatically; a maintainer may follow up.