mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6506] [Question]: #4378
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#4378
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 @GH102132 on GitHub (Sep 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6506
What are you trying to do?
How do I configure access to the internal network (192.168.1.0/24) via the AWG protocol if the router does not allow entering
10.8.1.1/32, 192.168.1.0/24into the client'sallowedIPsparameter?What have you already tried?
No response
3x-ui version
3.7.0
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Screenshots or config snippets
No response
Before submitting
@github-actions[bot] commented on GitHub (Sep 13, 2026):
Short answer: on the router you don't need the two-entry list at all — a single
0.0.0.0/0covers both10.8.1.1/32and192.168.1.0/24. But changing only the client side will not get you there, because 3x-ui deliberately blocks private-IP destinations in two places in the default Xray template, and that is what has to be opened for LAN access to work.1. The router / client side
The
.conf(and thevpn://link) the panel hands out never contains a split-tunnel list in the first place —frontend/src/pages/clients/amneziawgConfig.ts:107:The same literal is in
frontend/src/lib/xray/inbound-link.ts:989and:1105, and in the docs atconfig/amneziawg.0.0.0.0/0contains both addresses you wanted to list, so if the router's firmware accepts only one value, enter0.0.0.0/0(add::/0only if you use IPv6). Whether a comma-separated list is accepted is entirely the router firmware's business — nothing in 3x-ui restricts what you type there.One thing to avoid: do not put
192.168.1.0/24into the client's allowedIPs field in the panel. Server-side that field is the peer's own tunnel address, and the panel checks it fits the inbound's subnet (addressesFitAmneziaWGInbound,internal/web/service/client_crud.go:944-975); a value outside the tunnel subnet is dropped and replaced with a freshly allocated one (client_crud.go:216,:693).2. The server side — the part that is actually blocking you
The default Xray template
internal/web/service/config.jsonblocks private destinations twice:That second gate is SSRF hardening (#6037) and is applied to existing installs by the
FreedomFinalRulesPrivateEgressBlockmigration (internal/database/db.go:1931). It only rewrites default rule sets —internal/database/freedom_finalrules_migration_test.go:51pins a"customized rules are preserved"case — so once you customise it, upgrades leave your version alone.To open just your own subnet, in Xray Configs (replace
192.168.1.0/24with yours):freedomoutbound taggedlan, with one Final Rule: actionallow, IP/CIDR192.168.1.0/24.192.168.1.0/24→ outboundlan, and move it above the existinggeoip:private → blockedrule (first match wins, which is why the default order is block-then-allow).Equivalent JSON:
You can scope it to one tunnel by adding
"inboundTag": ["<your AmneziaWG inbound tag>"]to that routing rule: AmneziaWG peers relay into a loopback SOCKS5 inbound that carries the AmneziaWG inbound's own tag (internal/web/service/xray.go:774,Tag: inbound.Tag).3. Two limits worth knowing before you spend time on it
192.168.1.0/24. A peer's decapsulated traffic is relayed into that loopback SOCKS5 inbound and re-dialled by the Xray process on the host (internal/amneziawgnet/relay.go:68func (r SocksRelay) RelayTCP(...), inbound built atinternal/web/service/xray.go:766-775). If 3x-ui runs on a VPS with no link to that LAN, no routing rule can help.internal/amneziawgnet/manager.go:208AttachTCPForwarder(dev.Stack, …)and:223AttachUDPHandler(dev.Stack, next.handleUDP)); there is no ICMP relay. Test withcurl http://192.168.1.xor SSH, notping— otherwise a working setup looks broken. Tracked in #6366.4. If
192.168.1.0/24is the LAN behind the router, not behind the serverThen this is site-to-site, and the embedded AmneziaWG runtime does not do it: there is no OS interface and no DNAT, so traffic can only be pushed toward a peer through the per-client Forwarded ports feature, which opens a listener on the host and relays to that one client's tunnel address (
internal/amneziawgnet/portfwd.go:1-22) — a host port to one client, not a route into its LAN.Also worth checking, and the most likely reason a router refuses that exact pair: if the router's own LAN is also
192.168.1.0/24, it cannot route an identical remote subnet over the tunnel — that is a subnet collision, not a panel setting. Renumbering one of the two sides (e.g. the server-side LAN to192.168.77.0/24) is the only fix. I can't confirm this from your report, since it doesn't say which side the subnet is on or which router/firmware you use — if the recipe above doesn't work, post those two facts and the exact error the router shows as text.Related: #6423 (same LAN-access question, different second half). This recipe is not written up in the docs, which is a gap worth closing.
One housekeeping note: this issue was submitted with the title left as just
[Question]:, so it is hard to find later — a maintainer may want to retitle it to something like "How to reach a LAN through an AmneziaWG inbound when the client router won't accept a multi-entry AllowedIPs". I was not able to change the title or labels from here.Verdict: Not a bug (user configuration)
This reply was generated automatically; a maintainer may follow up.
@GH102132 commented on GitHub (Sep 13, 2026):
This is my first time using 3X-UI, and I don't quite understand most of the recommendations. My local network is behind a Keenetic router, and I want to access it from my mobile phone via the cellular network using AWG. 3X-UI is running on a rented server. When I used AWG via the AmneziaVPN app, I simply had to set
AllowedIPs = 10.8.1.3/32, 192.168.1.0/24in the client'sawg0.conffile, and everything worked on the server side. What exactly do I need to configure in 3X-UI? Here is my current configuration file:{
"inbounds": [
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "tunnel",
"settings": {
"rewriteAddress": "127.0.0.1"
},
"tag": "api"
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"domainStrategy": "AsIs",
"finalRules": [
{
"action": "allow",
"ip": [
"192.168.1.0/24"
]
},
{
"action": "block",
"ip": [
"geoip:private"
]
},
{
"action": "allow"
}
]
}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"rules": [
{
"type": "field",
"inboundTag": [
"api"
],
"outboundTag": "api"
},
{
"type": "field",
"ip": [
"192.168.1.0/24"
],
"outboundTag": "direct"
},
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
},
{
"type": "field",
"protocol": [
"bittorrent"
],
"outboundTag": "blocked"
}
],
"domainStrategy": "AsIs"
},
"log": {
"access": "none",
"dnsLog": false,
"error": "",
"loglevel": "warning",
"maskAddress": ""
},
"policy": {
"system": {
"statsInboundDownlink": true,
"statsInboundUplink": true,
"statsOutboundDownlink": false,
"statsOutboundUplink": false
},
"levels": {
"0": {
"statsUserDownlink": true,
"statsUserUplink": true
}
}
},
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService",
"RoutingService"
],
"tag": "api"
},
"metrics": {
"listen": "127.0.0.1:11111",
"tag": "metrics_out"
},
"stats": {}
}
@zamarawka commented on GitHub (Sep 15, 2026):
It looks like #6419 was trying to address this use case.
In 3x-ui 3.8.0, AmneziaWG runs entirely in userspace (amneziawg-go + gVisor), so there is no kernel network interface / kernel routing table involved. As a result, routed peer-to-peer scenarios don't seem to work - for example:
remote AWG client -> 3x-ui -> AWG peer acting as a router -> LAN behind that peerI've also tried to achieve the same with the WireGuard inbound in several 3x-ui versions, without success.
@MHSanaei, is supporting site-to-site / routed peer-to-peer networks intentionally out of scope for 3x-ui, or is this something you would consider supporting in the future?
The practical use case is having a router (e.g. Keenetic/OpenWrt) connected as a peer, with a private LAN behind it, while remote VPN peers can access that LAN without exposing any LAN services to the public Internet.