mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5110] [Bug]: Hysteria node becomes unreachable after like 1-2 hours when using port hopping, only recovers after restarting 3x-ui #3591
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#3591
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 @Tommytalk on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5110
Describe the bug
After configuring port hopping for a Hysteria node, the service works normally at first.
However, after approximately 1-2 hours, all clients lose connectivity to the node. The node becomes completely unreachable.
How to reproduce the problem
configuring port forwarding (port hopping) for a Hysteria node, the service works normally at first. waiting for like 1-2 hours, it becomes completely unreachable.
Expected behavior
The Hysteria node should remain reachable indefinitely after port forwarding is configured.
Actual behavior
After 1-2 hours:
Relevant logs
Screenshots
No response
3x-ui version
3.3.0 and previous
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
Debian 12
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 9, 2026):
Thanks for the detailed report, @Tommytalk.
What the code actually does for UDP Hop
After investigating the source:
UDP Hoptoggle in the inbound's FinalMask → QUIC Params section stores the port range infinalmask.quicParams.udpHop.portsinsidestreamSettings. This is passed verbatim to xray-core and controls the QUIC-layer port hopping.sub/subService.go,hysteriaHopPorts()) reads that value and emitsmport=<range>onhysteria2://share links (v2rayN-style) andports: <range>in Clash/mihomo output.iptables/nftablesPREROUTING rules for port forwarding. The inbound'sPortfield is a single integer; redirecting a port range to the listening port is handled externally (either by xray-core internally via theapernet/quic-golibrary, or by OS-level rules you set up yourself).Narrowing down the 1–2 hour window
The ~1–2 hour failure is the key diagnostic clue. To help pinpoint whether this is an xray-core issue or an OS networking/iptables issue, please provide:
x-uiand check the version line).iptables -t nat -L PREROUTING -v -nright after the failure and share the output — a common cause is these rules being flushed byufw,firewalld, or a kernel module reload.While you wait
If you need a temporary workaround, disabling UDP Hop (remove the
udpHopblock from quicParams) will make the inbound connect reliably on a single port until the root cause is confirmed.@MHSanaei commented on GitHub (Jun 11, 2026):
The panel side checks out: 3x-ui emits the port-hopping configuration correctly (the hop range is passed through to Xray-core and exported as
mportin subscription links). The node becoming unreachable after 1-2 hours and recovering only on restart points to QUIC/port-hop state management inside Xray-core itself, not the panel. Please report this to https://github.com/XTLS/Xray-core with the core logs from around the time the node stops responding — restarting 3x-ui "fixes" it only because it restarts the Xray process. Closing here as an upstream issue.