[GH-ISSUE #6882] [Question]: WG and AWG: how to add the Client’s local IP address from their local network. #4569

Closed
opened 2026-10-31 20:40:34 +07:00 by bsakaguchi · 2 comments
Owner

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

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
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](https://github.com/user-attachments/files/33712564/default.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 - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:40:34 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@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 add 192.168.1.0/24 to 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.

  • AmneziaWG: every TCP connection from a peer goes into Xray's SOCKS5 inbound and then to an Xray outbound (internal/amneziawgnet/manager.go:208-221, relay.RelayTCP(conn, peer.Email, dest); UDP takes the same route through AttachUDPHandler). Suppose another client connects to 192.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."
  • Allowed IPs doubles as the client's interface address. The .conf generator writes Address = <Allowed IPs> (internal/sub/service.go:998), and the wireguard:// link sets address from the same list (internal/sub/service.go:947-948).
  • The netstack only has handlers for TCP and UDP (manager.go:208, manager.go:223), so pinging hosts behind another peer is not relayed either.
  • The plain WireGuard inbound is Xray-core's own WireGuard inbound, which is also a proxy endpoint. Its peers' allowedIPs are 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 as 192.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 add 192.168.1.0/24 to that peer's AllowedIPs on 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.

<!-- gh-comment-id:6289058555 --> @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** add `192.168.1.0/24` to 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. - AmneziaWG: every TCP connection from a peer goes into Xray's SOCKS5 inbound and then to an Xray outbound (`internal/amneziawgnet/manager.go:208-221`, `relay.RelayTCP(conn, peer.Email, dest)`; UDP takes the same route through `AttachUDPHandler`). Suppose another client connects to `192.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."* - *Allowed IPs* doubles as the client's interface address. The `.conf` generator writes `Address = <Allowed IPs>` (`internal/sub/service.go:998`), and the `wireguard://` link sets `address` from the same list (`internal/sub/service.go:947-948`). - The netstack only has handlers for TCP and UDP (`manager.go:208`, `manager.go:223`), so pinging hosts behind another peer is not relayed either. - The plain WireGuard inbound is Xray-core's own WireGuard inbound, which is also a proxy endpoint. Its peers' `allowedIPs` are 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 as `192.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 add `192.168.1.0/24` to that peer's `AllowedIPs` on 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.* <!-- claude-issue:analyst -->
Author
Owner

@potap1978 commented on GitHub (Oct 20, 2026):

Краткий ответ: в настоящее время такой настройки нет. Ни WireGuard, ни AmneziaWG входящие соединения в 3x-ui не маршрутизируют трафик от одного клиента в туннель другого клиента, поэтому локальная сеть за одним клиентом ( 192.168.1.0/24) недоступна для других клиентов, независимо от того, как вы заполняете форму клиента. Пожалуйста, не добавляйте в поле «Разрешенные IP-адреса»192.168.1.0/24 клиента . Это поле также записывается в собственную конфигурацию клиента как адрес его интерфейса, поэтому добавление подсети нарушит конфигурацию этого клиента.__

Почему это не работает

Оба входящих канала работают как прокси, а не как маршрутизатор. Каждый TCP или UDP-поток, отправляемый клиентом в туннель, заканчивается на сервере, а затем открывается снова из собственной сети сервера. Никакие пакеты не передаются другому узлу.

  • AmneziaWG: каждое TCP-соединение от удаленного узла проходит через входящий SOCKS5-туннель Xray, а затем через исходящий SOCKS5-туннель Xray ( internal/amneziawgnet/manager.go:208-221, relay.RelayTCP(conn, peer.Email, dest); UDP проходит тот же маршрут через AttachUDPHandler). Предположим, другой клиент подключается к 192.168.1.10. Сервер набирает этот адрес из своей собственной сети, а не через удаленный узел, за которым находится подсеть. В коде четко указано, что у Xray нет маршрута в туннель ( internal/amneziawgnet/portfwd.go:13-15): «внутренний адрес туннеля, такой как 10.8.1.5:8080, не имеет маршрута из собственного исходящего SOCKS5-туннеля Xray; только код, содержащий фактический *stack.Stack, может достичь его».
  • Разрешенные IP-адреса одновременно служат адресом интерфейса клиента. .confГенератор записывает Address = <Allowed IPs>( internal/sub/service.go:998), а wireguard://параметры соединения выбираются addressиз того же списка ( internal/sub/service.go:947-948).
  • В сетевом стеке есть обработчики только для TCP и UDP ( manager.go:208, manager.go:223), поэтому пинг хостов, находящихся за другим узлом, также не передается.
  • Обычный входящий трафик WireGuard — это собственный входящий трафик WireGuard от Xray-core, который также является прокси-конечным пунктом. Трафик его соседей allowedIPsпередается напрямую в Xray ( internal/xray/api.go:719-732). Мое утверждение о том, что Xray никогда не отправляет этот трафик другому соседу, основано на принципах работы Xray-core; я не отслеживал это в данном репозитории.

Что может сделать комиссия?

AmneziaWG имеет функцию переадресации портов для каждого клиента . Она открывает TCP/UDP-порт на сервере и перенаправляет этот порт на собственный туннельный адрес клиента ( internal/amneziawgnet/portfwd.go:1-3). Она принимает только номера портов или диапазоны, ограниченные 100 портами на клиента ( internal/amneziawg/portfwd.go:16-20, MaxForwardedPorts = 100). Вы не можете перенаправить его на другой хост, например 192.168.1.x, . Поэтому это полезно только в том случае, если клиентское устройство само перенаправляет или NAT-транслирует эти порты в свою локальную сеть.

Для полного доступа по протоколу "сайт-сайт" (доступ других клиентов 192.168.1.0/24, включая ping) вам потребуется сервер WireGuard/AmneziaWG на базе обычного ядра вне 3x-ui. Там вы добавляете подсеть 192.168.1.0/24к этому пиру AllowedIPsна сервере, включаете пересылку IP-пакетов и добавляете подсеть к подсети других клиентов AllowedIPs.

Мне не удалось открыть прикрепленный файл .bmp. Если в нем отображается что-то отличное от описанного выше, пожалуйста, вставьте его как текст.

Вердикт: Это не ошибка (ожидаемое поведение). Маршрутизация локальной сети за клиентом к другим клиентам не поддерживается ни одним из типов входящих соединений; это будет запрос на добавление функции.

Этот ответ был сгенерирован автоматически; возможно, кто-то из сопровождающих проекта ответит позже.

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

<!-- gh-comment-id:6289641685 --> @potap1978 commented on GitHub (Oct 20, 2026): > Краткий ответ: в настоящее время такой настройки нет. Ни WireGuard, ни AmneziaWG входящие соединения в 3x-ui не маршрутизируют трафик от одного клиента в туннель другого клиента, поэтому локальная сеть за одним клиентом ( `192.168.1.0/24`) недоступна для других клиентов, независимо от того, как вы заполняете форму клиента. Пожалуйста, **не** добавляйте в поле _«Разрешенные IP-адреса»_`192.168.1.0/24` клиента . Это поле также записывается в собственную конфигурацию клиента как адрес его интерфейса, поэтому добавление подсети нарушит конфигурацию этого клиента.__ > > **Почему это не работает** > > Оба входящих канала работают как прокси, а не как маршрутизатор. Каждый TCP или UDP-поток, отправляемый клиентом в туннель, заканчивается на сервере, а затем открывается снова из собственной сети сервера. Никакие пакеты не передаются другому узлу. > > * AmneziaWG: каждое TCP-соединение от удаленного узла проходит через входящий SOCKS5-туннель Xray, а затем через исходящий SOCKS5-туннель Xray ( `internal/amneziawgnet/manager.go:208-221`, `relay.RelayTCP(conn, peer.Email, dest)`; UDP проходит тот же маршрут через `AttachUDPHandler`). Предположим, другой клиент подключается к `192.168.1.10`. Сервер набирает этот адрес из своей собственной сети, а не через удаленный узел, за которым находится подсеть. В коде четко указано, что у Xray нет маршрута в туннель ( `internal/amneziawgnet/portfwd.go:13-15`): _«внутренний адрес туннеля, такой как 10.8.1.5:8080, не имеет маршрута из собственного исходящего SOCKS5-туннеля Xray; только код, содержащий фактический *stack.Stack, может достичь его»._ > * _Разрешенные IP-адреса_ одновременно служат адресом интерфейса клиента. `.conf`Генератор записывает `Address = <Allowed IPs>`( `internal/sub/service.go:998`), а `wireguard://`параметры соединения выбираются `address`из того же списка ( `internal/sub/service.go:947-948`). > * В сетевом стеке есть обработчики только для TCP и UDP ( `manager.go:208`, `manager.go:223`), поэтому пинг хостов, находящихся за другим узлом, также не передается. > * Обычный входящий трафик WireGuard — это собственный входящий трафик WireGuard от Xray-core, который также является прокси-конечным пунктом. Трафик его соседей `allowedIPs`передается напрямую в Xray ( `internal/xray/api.go:719-732`). Мое утверждение о том, что Xray никогда не отправляет этот трафик другому соседу, основано на принципах работы Xray-core; я не отслеживал это в данном репозитории. > > **Что может сделать комиссия?** > > _AmneziaWG имеет функцию переадресации портов_ для каждого клиента . Она открывает TCP/UDP-порт на сервере и перенаправляет этот порт на **собственный туннельный адрес клиента** ( `internal/amneziawgnet/portfwd.go:1-3`). Она принимает только номера портов или диапазоны, ограниченные 100 портами на клиента ( `internal/amneziawg/portfwd.go:16-20`, `MaxForwardedPorts = 100`). Вы не можете перенаправить его на другой хост, например `192.168.1.x`, . Поэтому это полезно только в том случае, если клиентское устройство само перенаправляет или NAT-транслирует эти порты в свою локальную сеть. > > Для полного доступа по протоколу "сайт-сайт" (доступ других клиентов `192.168.1.0/24`, включая ping) вам потребуется сервер WireGuard/AmneziaWG на базе обычного ядра вне 3x-ui. Там вы добавляете подсеть `192.168.1.0/24`к этому пиру `AllowedIPs`на сервере, включаете пересылку IP-пакетов и добавляете подсеть к подсети других клиентов `AllowedIPs`. > > Мне не удалось открыть прикрепленный файл `.bmp`. Если в нем отображается что-то отличное от описанного выше, пожалуйста, вставьте его как текст. > > Вердикт: Это не ошибка (ожидаемое поведение). Маршрутизация локальной сети за клиентом к другим клиентам не поддерживается ни одним из типов входящих соединений; это будет запрос на добавление функции. > > _Этот ответ был сгенерирован автоматически; возможно, кто-то из сопровождающих проекта ответит позже._ 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
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#4569
No description provided.