mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6882] [Question]: WG and AWG: how to add the Client’s local IP address from their local network. #4569
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#4569
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 @potap1978 on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6882
What are you trying to do?
In WireGuard and Amneziawg, there is a subnet 192.168.1.0 behind the client. How or where should it be added in the client settings so that other clients can c
Новый точечный рисунок.bmp
onnect or ping the IP address on the client’s local network?
What have you already tried?
No response
3x-ui version
3.10.2
How did you install 3x-ui?
Other
Operating system
24.04
Screenshots or config snippets
No response
Before submitting
@github-actions[bot] commented on GitHub (Oct 20, 2026):
Short answer: there is currently no setting for this. Neither the WireGuard nor the AmneziaWG inbound in 3x-ui routes traffic from one client into another client's tunnel, so a LAN behind a client (
192.168.1.0/24) cannot be reached by other clients however you fill in the client form. Please do not add192.168.1.0/24to the client's Allowed IPs field. That field is also written into the client's own config as its interface address, so adding the subnet breaks that client's config.Why it does not work
Both inbounds work as a proxy, not as a router. Each TCP or UDP flow a client sends into the tunnel ends at the server and is then opened again from the server's own network. Nothing passes packets on to another peer.
internal/amneziawgnet/manager.go:208-221,relay.RelayTCP(conn, peer.Email, dest); UDP takes the same route throughAttachUDPHandler). Suppose another client connects to192.168.1.10. The server dials that address from its own network, not through the peer that has the subnet behind it. The code says plainly that Xray has no route into the tunnel (internal/amneziawgnet/portfwd.go:13-15): "a tunnel-internal address like 10.8.1.5:8080 has no route from Xray's own freedom outbound; only code holding the actual *stack.Stack can reach it.".confgenerator writesAddress = <Allowed IPs>(internal/sub/service.go:998), and thewireguard://link setsaddressfrom the same list (internal/sub/service.go:947-948).manager.go:208,manager.go:223), so pinging hosts behind another peer is not relayed either.allowedIPsare passed straight to Xray (internal/xray/api.go:719-732). My statement that Xray never sends that traffic to another peer comes from how Xray-core works; I did not trace it in this repository.What the panel can do
AmneziaWG has a per-client forwarded ports feature. It opens a TCP/UDP port on the server and relays that port to the client's own tunnel address (
internal/amneziawgnet/portfwd.go:1-3). It accepts only port numbers or ranges, capped at 100 ports per client (internal/amneziawg/portfwd.go:16-20,MaxForwardedPorts = 100). You cannot point it at a different host such as192.168.1.x. So it only helps if the client device itself forwards or NATs those ports onward into its LAN.For full site-to-site access (other clients reaching
192.168.1.0/24, including ping), you need a plain kernel WireGuard/AmneziaWG server outside 3x-ui. There you add192.168.1.0/24to that peer'sAllowedIPson the server, enable IP forwarding, and add the subnet to the other clients'AllowedIPs.I could not open the attached
.bmp. If it shows something other than what is described above, please paste it as text.Verdict: Not a bug (expected behaviour). Routing a LAN behind a client to other clients is not supported by either inbound type; that would be a feature request.
This reply was generated automatically; a maintainer may follow up.
@potap1978 commented on GitHub (Oct 20, 2026):
Add the 192.168.1.0/24 network to the client like this.
[Interface]
Address = 10.62.62.1/24,fd42:42:42::1/64
ListenPort = 2408
PrivateKey = OFyjtHc8XmJKQu7/6EQ=
Jc = 10
Jmin = 50
Jmax = 100
S1 = 128
S2 = 39
H1 = 23269155
H2 = 191449680
H3 = 37590196
H4 = 192572127
Client DAFdiag
[Peer]
PublicKey = 0drTVBInd5oIvCnE/cd1Zzf8h3BJRC91ZC4=
PresharedKey = HgS7GW4d26J9it0CZ2tzdBDftPOLB1vBVI=
AllowedIPs = 10.62.62.2/32,192.168.1.0/24