[GH-ISSUE #6506] [Question]: #4378

Closed
opened 2026-10-31 20:39:15 +07:00 by bsakaguchi · 3 comments
Owner

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/24 into the client's allowedIPs parameter?

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

  • 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 @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/24` into the client's `allowedIPs` parameter? ### 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 - [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:39:15 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@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/0 covers both 10.8.1.1/32 and 192.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 the vpn:// link) the panel hands out never contains a split-tunnel list in the first place — frontend/src/pages/clients/amneziawgConfig.ts:107:

lines.push('AllowedIPs = 0.0.0.0/0, ::/0', `Endpoint = ${endpoint}`);

The same literal is in frontend/src/lib/xray/inbound-link.ts:989 and :1105, and in the docs at config/amneziawg. 0.0.0.0/0 contains both addresses you wanted to list, so if the router's firmware accepts only one value, enter 0.0.0.0/0 (add ::/0 only 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/24 into 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.json blocks private destinations twice:

// lines 71-77 — routing sends anything private to the blackhole
{ "ip": ["geoip:private"], "outboundTag": "blocked", "type": "field" }

// lines 35-38 — and the "direct" freedom outbound blocks it again on egress
"finalRules": [
  { "action": "block", "ip": ["geoip:private"] },
  { "action": "allow" }
]

That second gate is SSRF hardening (#6037) and is applied to existing installs by the FreedomFinalRulesPrivateEgressBlock migration (internal/database/db.go:1931). It only rewrites default rule sets — internal/database/freedom_finalrules_migration_test.go:51 pins 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/24 with yours):

  1. Outbounds → add a freedom outbound tagged lan, with one Final Rule: action allow, IP/CIDR 192.168.1.0/24.
  2. Routing → add a rule IP 192.168.1.0/24 → outbound lan, and move it above the existing geoip:private → blocked rule (first match wins, which is why the default order is block-then-allow).

Equivalent JSON:

{ "protocol": "freedom", "tag": "lan",
  "settings": { "finalRules": [ { "action": "allow", "ip": ["192.168.1.0/24"] } ] } }
{ "type": "field", "ip": ["192.168.1.0/24"], "outboundTag": "lan" }

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

  • The panel host itself must be able to reach 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:68 func (r SocksRelay) RelayTCP(...), inbound built at internal/web/service/xray.go:766-775). If 3x-ui runs on a VPS with no link to that LAN, no routing rule can help.
  • Ping will not work even when TCP/UDP does. Only a TCP forwarder and a UDP handler are attached to the tunnel's netstack (internal/amneziawgnet/manager.go:208 AttachTCPForwarder(dev.Stack, …) and :223 AttachUDPHandler(dev.Stack, next.handleUDP)); there is no ICMP relay. Test with curl http://192.168.1.x or SSH, not ping — otherwise a working setup looks broken. Tracked in #6366.

4. If 192.168.1.0/24 is the LAN behind the router, not behind the server

Then 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 to 192.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.

<!-- gh-comment-id:5653967884 --> @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/0` covers both `10.8.1.1/32` and `192.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 the `vpn://` link) the panel hands out never contains a split-tunnel list in the first place — `frontend/src/pages/clients/amneziawgConfig.ts:107`: ```ts lines.push('AllowedIPs = 0.0.0.0/0, ::/0', `Endpoint = ${endpoint}`); ``` The same literal is in `frontend/src/lib/xray/inbound-link.ts:989` and `:1105`, and in the docs at [`config/amneziawg`](https://github.com/MHSanaei/3x-ui/blob/main/docs/content/docs/en/config/amneziawg.mdx#L162). `0.0.0.0/0` contains both addresses you wanted to list, so if the router's firmware accepts only one value, enter `0.0.0.0/0` (add `::/0` only 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/24` into 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.json` blocks private destinations twice: ```jsonc // lines 71-77 — routing sends anything private to the blackhole { "ip": ["geoip:private"], "outboundTag": "blocked", "type": "field" } // lines 35-38 — and the "direct" freedom outbound blocks it again on egress "finalRules": [ { "action": "block", "ip": ["geoip:private"] }, { "action": "allow" } ] ``` That second gate is SSRF hardening (#6037) and is applied to existing installs by the `FreedomFinalRulesPrivateEgressBlock` migration (`internal/database/db.go:1931`). It only rewrites *default* rule sets — `internal/database/freedom_finalrules_migration_test.go:51` pins 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/24` with yours): 1. **Outbounds** → add a `freedom` outbound tagged `lan`, with one **Final Rule**: action `allow`, IP/CIDR `192.168.1.0/24`. 2. **Routing** → add a rule IP `192.168.1.0/24` → outbound `lan`, and **move it above** the existing `geoip:private → blocked` rule (first match wins, which is why the default order is block-then-allow). Equivalent JSON: ```json { "protocol": "freedom", "tag": "lan", "settings": { "finalRules": [ { "action": "allow", "ip": ["192.168.1.0/24"] } ] } } ``` ```json { "type": "field", "ip": ["192.168.1.0/24"], "outboundTag": "lan" } ``` 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 - **The panel host itself must be able to reach `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:68` `func (r SocksRelay) RelayTCP(...)`, inbound built at `internal/web/service/xray.go:766-775`). If 3x-ui runs on a VPS with no link to that LAN, no routing rule can help. - **Ping will not work even when TCP/UDP does.** Only a TCP forwarder and a UDP handler are attached to the tunnel's netstack (`internal/amneziawgnet/manager.go:208` `AttachTCPForwarder(dev.Stack, …)` and `:223` `AttachUDPHandler(dev.Stack, next.handleUDP)`); there is no ICMP relay. Test with `curl http://192.168.1.x` or SSH, not `ping` — otherwise a working setup looks broken. Tracked in #6366. ## 4. If `192.168.1.0/24` is the LAN *behind the router*, not behind the server Then 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 to `192.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.* <!-- claude-issue:analyst -->
Author
Owner

@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/24 in the client's awg0.conf file, 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": {}
}

<!-- gh-comment-id:5654374499 --> @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/24` in the client's `awg0.conf` file, 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": {} }
Author
Owner

@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 peer

I'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.

<!-- gh-comment-id:5674126128 --> @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 peer` I'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.
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#4378
No description provided.