[GH-ISSUE #6570] [Bug]: Awg outbound can't connect to the server #4402

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

Originally created by @AdLf0208 on GitHub (Sep 16, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6570

Describe the bug

I wanted to try out awg outbound and stuck with the issue of not being able to connect to the server. On my Keenetic router and android everything works as intended. I thought that as based on awg documentation if I were to delete I1 then system would fallback to awg 1.0 or 1.5 implementation but even that didn't help. Routing itself works via xray, I can see that outbound works on my awg easy server panel but 50 percent of the time probing the http or real delay results in fail.

Image

And right after this failed attempt:

Image

I got suspicious since there no I2 to I5 parametrs and only I1 available in the UI. Is that an intended behaviour?

Image

No I2 to I5 which I can specify and I assume that's why server fails to response properly

Also I don't quite understand why it's using Ipv6 if I excplicitely used Ipv4 in my configuration and even if used domain could it realize that ipv6 is unavailable and fallback to ipv4? (See the logs)

How to reproduce the problem

  1. Create an awg outbound
  2. Probe the outbound using built-in HTTP or Real Delay
  3. See probing resulted in 50/50 percent chance of being dropped or failed

Expected behavior

No response

Actual behavior

No response

Relevant logs

WARNING - X-UI: amneziawgnet: egress "awg": dial tunnel [2001:4860:4826:7700::]:443: connect tcp [2001:4860:4826:7700::]:443: network is unreachable
2026/09/16 14:01:02 WARNING - XRAY: core: Xray 26.9.9 started
2026/09/16 14:01:02 WARNING - XRAY: proxy/wireguard: Using gVisor TUN

Screenshots

No response

3x-ui version

3.8.5

Xray-core version

25.9.9

How did you install 3x-ui?

install.sh script

Operating system

docker

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

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @AdLf0208 on GitHub (Sep 16, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6570 ### Describe the bug I wanted to try out awg outbound and stuck with the issue of not being able to connect to the server. On my Keenetic router and android everything works as intended. I thought that as based on awg documentation if I were to delete I1 then system would fallback to awg 1.0 or 1.5 implementation but even that didn't help. Routing itself works via xray, I can see that outbound works on my awg easy server panel but 50 percent of the time probing the http or real delay results in fail. <img width="1735" height="93" alt="Image" src="https://github.com/user-attachments/assets/fa0cd41f-4d6f-4542-a227-1149037cbd06" /> And right after this failed attempt: <img width="1735" height="93" alt="Image" src="https://github.com/user-attachments/assets/31550d30-27fd-4daa-9f67-31cea57fb486" /> I got suspicious since there no I2 to I5 parametrs and only I1 available in the UI. Is that an intended behaviour? <img width="655" height="193" alt="Image" src="https://github.com/user-attachments/assets/4cff9a73-2cfa-4eb3-bc9f-039992aa4a7a" /> No I2 to I5 which I can specify and I assume that's why server fails to response properly Also I don't quite understand why it's using Ipv6 if I excplicitely used Ipv4 in my configuration and even if used domain could it realize that ipv6 is unavailable and fallback to ipv4? (See the logs) ### How to reproduce the problem 1. Create an awg outbound 2. Probe the outbound using built-in HTTP or Real Delay 3. See probing resulted in 50/50 percent chance of being dropped or failed ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell WARNING - X-UI: amneziawgnet: egress "awg": dial tunnel [2001:4860:4826:7700::]:443: connect tcp [2001:4860:4826:7700::]:443: network is unreachable 2026/09/16 14:01:02 WARNING - XRAY: core: Xray 26.9.9 started 2026/09/16 14:01:02 WARNING - XRAY: proxy/wireguard: Using gVisor TUN ``` ### Screenshots _No response_ ### 3x-ui version 3.8.5 ### Xray-core version 25.9.9 ### How did you install 3x-ui? install.sh script ### Operating system docker ### 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 - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:39:26 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Sep 16, 2026):

Confirmed bug — but not the one you suspected. The missing I2–I5 fields are a real UI gap (details at the bottom), yet they are not what makes your probes fail. Your tunnel handshake is clearly working; what fails is the panel's own in-tunnel DNS, which falls back to an AAAA record on an IPv4-only tunnel and then tries to dial an address the tunnel has no route for.

Why it dialled IPv6 even though your config is IPv4-only

Your log line is emitted verbatim here:

// internal/amneziawgnet/egress.go:395
logger.Warningf("amneziawgnet: egress %q: dial tunnel %s: %v", tag, dest, err)

The destination that reached that line was already an IPv6 address. It got there like this:

  1. The HTTP / Real Delay probe uses defaultTestURL = "https://www.google.com/generate_204" (internal/web/service/outbound/probe_http.go:63) — 2001:4860::/32 is Google's range, and the port in your log is 443. The temp probe config is built with "domainStrategy": "AsIs" and no dns section (probe_http.go:451), and as the code itself notes, "The test URL's hostname is resolved by xray (Go's SOCKS5 client sends the domain to the proxy), so DNS goes through the outbound too" (probe_http.go:491-492). So the domain, not an IP, arrives at the AmneziaWG egress.

  2. The egress resolves it inside your tunnel. exchangeTunnelDNSWithFallback decides which record types to ask for:

// internal/amneziawgnet/dns.go:140-161
hasV4 := deviceHasV4(addrs)
hasV6 := deviceHasV6(addrs)

// If the tunnel is IPv6-only, query AAAA first; else query A first.
types := []dnsmessage.Type{dnsmessage.TypeA, dnsmessage.TypeAAAA}
if hasV6 && !hasV4 {
    types = []dnsmessage.Type{dnsmessage.TypeAAAA, dnsmessage.TypeA}
}

var firstErr error
for _, qType := range types {
    // Skip AAAA if device has no IPv6 capability and has IPv4, unless A failed.
    addr, err := exchangeTunnelDNSQuery(ctx, conn, host, qType)
    if err == nil {
        return addr, nil
    }
    ...
}

hasV6 is used only to reorder the two queries. It never excludes AAAA. So when the A query fails, the loop asks for AAAA and happily returns an IPv6 address on a tunnel whose address list is IPv4-only.

  1. That address is undialable by construction. The embedded netstack installs an IPv6 default route only if the device has an IPv6 local address:
// internal/amneziawgnet/netstack.go:92-97
if hasV4 {
    dev.stack.AddRoute(tcpip.Route{Destination: header.IPv4EmptySubnet, NIC: 1})
}
if hasV6 {
    dev.stack.AddRoute(tcpip.Route{Destination: header.IPv6EmptySubnet, NIC: 1})
}

hasV6 comes from the outbound's Address field (internal/amneziawgnet/client_device.go:101,108,120), not from the peer's AllowedIPs. The form pre-fills allowedIPs: ['0.0.0.0/0', '::/0'] (frontend/src/pages/xray/outbounds/protocols/amneziawg.tsx:98), so the config looks dual-stack while the netstack is v4-only — exactly the mismatch you hit. relayTCP then dials with tunnelNetwork(dest.Addr()) (internal/amneziawgnet/portfwd.go:275-280), gets "network is unreachable", logs, and returns SOCKS failure 0x01. There is no retry and no fall back to the A record.

Why it looks like a clean 50/50

Two amplifiers, both citable:

  • The A lookup has a short budget: tunnelDNSPacketTimeout = 1200 * time.Millisecond × tunnelDNSAttempts = 3 = 3.6 s (dns.go:56-58). A cold tunnel that is still completing its WireGuard handshake can eat that whole budget, after which the AAAA branch runs against a now-warm tunnel and succeeds.
  • Whatever comes back is cached for tunnelDNSCacheTTL = 60 * time.Second under a key of tag|dnsServer|host with no address-family component (dns.go:72, 77-79, 116-121). So one unlucky AAAA fallback poisons every probe of that host for the next minute, which turns a rare race into long alternating runs of pass/fail.

A second, independent way into the same dead end: literal IP targets skip the check entirely —

// internal/amneziawgnet/egress.go:361-364
func (t socksTarget) resolveTunnelVia(dnsServer, tag string, dev *Device) (netip.AddrPort, error) {
	if t.ip.IsValid() {
		return netip.AddrPortFrom(t.ip, t.port), nil
	}

so if your main Xray routing uses domainStrategy: IPIfNonMatch/IPOnDemand, or Xray's built-in DNS hands over an AAAA, real traffic hits the identical failure. (You may also see harmless 2606:4700:… warnings from the same log line: the non-real-delay probe deliberately dials Cloudflare's IPv6 literal for egress metadata and ignores the result — probe_http.go:588-634.)

What you can do today

Neither of these removes the fallback; they stop the A lookup from losing in the first place.

  1. Set DNS on the AmneziaWG outbound to a resolver that answers fast inside the tunnel — your awg-easy server's in-tunnel resolver, e.g. 10.8.0.1, rather than leaving it empty (empty defaults to 1.1.1.1:53, internal/amneziawgnet/dns.go:23,47-52). The field accepts a bare IP or IP:port; a hostname is rejected (internal/amneziawg/outbound.go:240-254).
  2. If your server actually assigns you an IPv6, add it to the outbound's Address list — that makes the netstack install the v6 route and the AAAA answers become genuinely dialable.

To confirm the diagnosis on your box, restart with XUI_LOG_LEVEL=debug and look for amneziawgnet: resolved tag="awg" "www.google.com" -> … via tunnel (dns.go:122) right before a failure. An IPv6 on that line proves the AAAA fallback fired.

The I2–I5 question — yes, that is a separate real gap

The outbound form renders only i1:

// frontend/src/pages/xray/outbounds/protocols/amneziawg.tsx:81
<ObfText name="i1" label={t('pages.xray.amneziawg.i1')} placeholder="<r 64>" />

while the inbound form renders all five (frontend/src/pages/inbounds/form/protocols/amneziawg.tsx:134-152). Everything behind the form already supports I1–I5: the Zod schema (frontend/src/schemas/protocols/outbound/amneziawg.ts:33-37), the wire adapter in both directions (frontend/src/lib/xray/outbound-form-adapter.ts:433-437 and 479-495), the Go settings struct (internal/amneziawg/outbound.go:58-62), InstanceFromOutbound (outbound.go:152) and the UAPI renderer (internal/amneziawgnet/client_device.go:35-39). The form's own hint reads "Must exactly match the server side parameters." (internal/web/translation/en-US.json:2150), which you cannot satisfy for a server that sets I2–I5.

Workaround: Xray → Advanced → outboundSettings, and add "i2"…"i5" to the outbound's settings object by hand. The adapter preserves them on later form edits (outbound-form-adapter.ts:479-495), so they will not be silently dropped.

One correction to the assumption in your report: an obfuscation mismatch prevents the handshake outright rather than causing per-request 50/50 failures, and your peer is visibly up in awg-easy — so I1–I5 are not the cause here. (That part is protocol reasoning about amneziawg-go, not something this repository pins.) Removing I1 does exactly what you expected on the panel side: the line is simply omitted from the UAPI config when empty (client_device.go:35).

I could not read the two attached screenshots. If the probe errors they show say something other than what is analysed above, please paste the exact error text and I will re-check.

Verdict: Confirmed bug
Severity: High
Confidence: High for the code path and the log line; Medium that the AAAA fallback (rather than an IPv6 literal from your main routing config) is the trigger in your specific run, since the log line prints the dial, not the address's origin.
Root cause: exchangeTunnelDNSWithFallback in internal/amneziawgnet/dns.go:140-161 retries the other address family whenever the first query fails, gating only the order on deviceHasV6 (line 146) and never excluding AAAA on a device with no IPv6 local address. internal/amneziawgnet/netstack.go:95-97 installs an IPv6 default route only when the device has an IPv6 address, so the returned AAAA is unroutable and relayTCP (internal/amneziawgnet/egress.go:383-398) fails with "network is unreachable". The 60 s family-agnostic cache at dns.go:72,116-121 then holds the bad answer. Trigger: an AmneziaWG outbound whose address is IPv4-only, a dual-stack destination host, and any A-query failure inside the tunnel (a cold handshake is enough). Introduced with the feature itself in d5ab84e8 feat(amneziawg): add AmneziaWG as an outbound protocol (#6320). The secondary path, an IPv6 literal from Xray, is unguarded at egress.go:361-364.
Already fixed: Still present on the default branch. git log -- internal/amneziawgnet/dns.go internal/amneziawgnet/egress.go shows only d5ab84e8 and 3f1e52f0 (refactor(panel): drop two duplicated helpers); no behavioural change since. d5ab84e8 is tagged v3.8.0, v3.8.5 and dev-latest.
Duplicate of: None. The three AmneziaWG issues that surface on these keywords — #6302, #6303, #6310 — are a feature request, an inbound throughput report and a Clash-subscription omission, all with different root causes.
Evidence: internal/amneziawgnet/dns.go:141-160 (hasV6 only reorders types; the loop tries both families regardless); internal/amneziawgnet/dns.go:56-58 (tunnelDNSPacketTimeout = 1200 * time.Millisecond, tunnelDNSAttempts = 3 → a 3.6 s A-query budget inside a tunnelResolveTimeout = 4 * time.Second context); internal/amneziawgnet/dns.go:72,77-79,116-121 (60 s cache, key tag|dnsServer|host, no family); internal/amneziawgnet/netstack.go:92-97 (if hasV6 { AddRoute(IPv6EmptySubnet) }); internal/amneziawgnet/client_device.go:101,108,120 (localAddrs comes from inst.Address, not from peer AllowedIPs); internal/amneziawgnet/egress.go:395 (the exact warning string) and egress.go:361-364 (literal IPs bypass any family check); internal/web/service/outbound/probe_http.go:63,451,491-492 (Google probe URL, domainStrategy: "AsIs", domain forwarded to the proxy). No test pins the current behaviour: deviceHasV6 has exactly one caller (dns.go:142), and internal/amneziawgnet/egress_domain_test.go:650-660 covers only defaultDNSFor. UI gap: frontend/src/pages/xray/outbounds/protocols/amneziawg.tsx:81 vs frontend/src/pages/inbounds/form/protocols/amneziawg.tsx:134-152, with backend support at internal/amneziawg/outbound.go:58-62,152 and internal/amneziawgnet/client_device.go:35-39.
Not determined: Whether this particular run went through the AAAA fallback or through an IPv6 literal handed over by the reporter's main routing config. A single XUI_LOG_LEVEL=debug run showing the dns.go:122 "resolved … via tunnel" line immediately before the failure settles it.

Suggested fix: Gate the second-family retry in exchangeTunnelDNSWithFallback on the device actually having that family — skip AAAA when !deviceHasV6(addrs) and skip A when !deviceHasV4(addrs) — so an unroutable answer is never returned or cached. The literal-IP path at egress.go:361-364 wants the same one-line family check so an IPv6 literal from Xray fails with a clear reason rather than a dial timeout.

@MHSanaei — confirmed High-severity defect in the AmneziaWG outbound egress; root cause and suggested fix above.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5696165794 --> @github-actions[bot] commented on GitHub (Sep 16, 2026): **Confirmed bug — but not the one you suspected.** The missing I2–I5 fields are a real UI gap (details at the bottom), yet they are *not* what makes your probes fail. Your tunnel handshake is clearly working; what fails is the panel's own in-tunnel DNS, which falls back to an **AAAA** record on an **IPv4-only** tunnel and then tries to dial an address the tunnel has no route for. ## Why it dialled IPv6 even though your config is IPv4-only Your log line is emitted verbatim here: ```go // internal/amneziawgnet/egress.go:395 logger.Warningf("amneziawgnet: egress %q: dial tunnel %s: %v", tag, dest, err) ``` The destination that reached that line was already an IPv6 address. It got there like this: 1. The HTTP / Real Delay probe uses `defaultTestURL = "https://www.google.com/generate_204"` (`internal/web/service/outbound/probe_http.go:63`) — `2001:4860::/32` is Google's range, and the port in your log is `443`. The temp probe config is built with `"domainStrategy": "AsIs"` and no `dns` section (`probe_http.go:451`), and as the code itself notes, *"The test URL's hostname is resolved by xray (Go's SOCKS5 client sends the domain to the proxy), so DNS goes through the outbound too"* (`probe_http.go:491-492`). So the **domain**, not an IP, arrives at the AmneziaWG egress. 2. The egress resolves it inside your tunnel. `exchangeTunnelDNSWithFallback` decides which record types to ask for: ```go // internal/amneziawgnet/dns.go:140-161 hasV4 := deviceHasV4(addrs) hasV6 := deviceHasV6(addrs) // If the tunnel is IPv6-only, query AAAA first; else query A first. types := []dnsmessage.Type{dnsmessage.TypeA, dnsmessage.TypeAAAA} if hasV6 && !hasV4 { types = []dnsmessage.Type{dnsmessage.TypeAAAA, dnsmessage.TypeA} } var firstErr error for _, qType := range types { // Skip AAAA if device has no IPv6 capability and has IPv4, unless A failed. addr, err := exchangeTunnelDNSQuery(ctx, conn, host, qType) if err == nil { return addr, nil } ... } ``` `hasV6` is used **only to reorder** the two queries. It never excludes AAAA. So when the A query fails, the loop asks for AAAA and happily returns an IPv6 address on a tunnel whose address list is IPv4-only. 3. That address is undialable by construction. The embedded netstack installs an IPv6 default route only if the device has an IPv6 local address: ```go // internal/amneziawgnet/netstack.go:92-97 if hasV4 { dev.stack.AddRoute(tcpip.Route{Destination: header.IPv4EmptySubnet, NIC: 1}) } if hasV6 { dev.stack.AddRoute(tcpip.Route{Destination: header.IPv6EmptySubnet, NIC: 1}) } ``` `hasV6` comes from the outbound's **Address** field (`internal/amneziawgnet/client_device.go:101,108,120`), not from the peer's `AllowedIPs`. The form pre-fills `allowedIPs: ['0.0.0.0/0', '::/0']` (`frontend/src/pages/xray/outbounds/protocols/amneziawg.tsx:98`), so the config *looks* dual-stack while the netstack is v4-only — exactly the mismatch you hit. `relayTCP` then dials with `tunnelNetwork(dest.Addr())` (`internal/amneziawgnet/portfwd.go:275-280`), gets "network is unreachable", logs, and returns SOCKS failure `0x01`. There is no retry and no fall back to the A record. ## Why it looks like a clean 50/50 Two amplifiers, both citable: - The A lookup has a short budget: `tunnelDNSPacketTimeout = 1200 * time.Millisecond` × `tunnelDNSAttempts = 3` = **3.6 s** (`dns.go:56-58`). A cold tunnel that is still completing its WireGuard handshake can eat that whole budget, after which the AAAA branch runs against a now-warm tunnel and succeeds. - Whatever comes back is cached for `tunnelDNSCacheTTL = 60 * time.Second` under a key of `tag|dnsServer|host` with **no address-family component** (`dns.go:72, 77-79, 116-121`). So one unlucky AAAA fallback poisons every probe of that host for the next minute, which turns a rare race into long alternating runs of pass/fail. A second, independent way into the same dead end: literal IP targets skip the check entirely — ```go // internal/amneziawgnet/egress.go:361-364 func (t socksTarget) resolveTunnelVia(dnsServer, tag string, dev *Device) (netip.AddrPort, error) { if t.ip.IsValid() { return netip.AddrPortFrom(t.ip, t.port), nil } ``` so if your **main** Xray routing uses `domainStrategy: IPIfNonMatch`/`IPOnDemand`, or Xray's built-in DNS hands over an AAAA, real traffic hits the identical failure. (You may also see harmless `2606:4700:…` warnings from the same log line: the non-real-delay probe deliberately dials Cloudflare's IPv6 literal for egress metadata and ignores the result — `probe_http.go:588-634`.) ### What you can do today Neither of these removes the fallback; they stop the A lookup from losing in the first place. 1. Set **DNS** on the AmneziaWG outbound to a resolver that answers fast *inside* the tunnel — your awg-easy server's in-tunnel resolver, e.g. `10.8.0.1`, rather than leaving it empty (empty defaults to `1.1.1.1:53`, `internal/amneziawgnet/dns.go:23,47-52`). The field accepts a bare IP or `IP:port`; a hostname is rejected (`internal/amneziawg/outbound.go:240-254`). 2. If your server actually assigns you an IPv6, add it to the outbound's **Address** list — that makes the netstack install the v6 route and the AAAA answers become genuinely dialable. To confirm the diagnosis on your box, restart with `XUI_LOG_LEVEL=debug` and look for `amneziawgnet: resolved tag="awg" "www.google.com" -> … via tunnel` (`dns.go:122`) right before a failure. An IPv6 on that line proves the AAAA fallback fired. ## The I2–I5 question — yes, that is a separate real gap The outbound form renders only `i1`: ```tsx // frontend/src/pages/xray/outbounds/protocols/amneziawg.tsx:81 <ObfText name="i1" label={t('pages.xray.amneziawg.i1')} placeholder="<r 64>" /> ``` while the **inbound** form renders all five (`frontend/src/pages/inbounds/form/protocols/amneziawg.tsx:134-152`). Everything behind the form already supports I1–I5: the Zod schema (`frontend/src/schemas/protocols/outbound/amneziawg.ts:33-37`), the wire adapter in both directions (`frontend/src/lib/xray/outbound-form-adapter.ts:433-437` and `479-495`), the Go settings struct (`internal/amneziawg/outbound.go:58-62`), `InstanceFromOutbound` (`outbound.go:152`) and the UAPI renderer (`internal/amneziawgnet/client_device.go:35-39`). The form's own hint reads *"Must exactly match the server side parameters."* (`internal/web/translation/en-US.json:2150`), which you cannot satisfy for a server that sets I2–I5. **Workaround:** *Xray* → *Advanced* → `outboundSettings`, and add `"i2"`…`"i5"` to the outbound's settings object by hand. The adapter preserves them on later form edits (`outbound-form-adapter.ts:479-495`), so they will not be silently dropped. One correction to the assumption in your report: an obfuscation mismatch prevents the handshake outright rather than causing per-request 50/50 failures, and your peer is visibly up in awg-easy — so I1–I5 are not the cause here. (That part is protocol reasoning about amneziawg-go, not something this repository pins.) Removing `I1` does exactly what you expected on the panel side: the line is simply omitted from the UAPI config when empty (`client_device.go:35`). I could not read the two attached screenshots. If the probe errors they show say something other than what is analysed above, please paste the exact error text and I will re-check. Verdict: Confirmed bug Severity: High Confidence: High for the code path and the log line; Medium that the AAAA fallback (rather than an IPv6 literal from your main routing config) is the trigger in your specific run, since the log line prints the dial, not the address's origin. Root cause: `exchangeTunnelDNSWithFallback` in `internal/amneziawgnet/dns.go:140-161` retries the other address family whenever the first query fails, gating only the *order* on `deviceHasV6` (line 146) and never excluding AAAA on a device with no IPv6 local address. `internal/amneziawgnet/netstack.go:95-97` installs an IPv6 default route only when the device has an IPv6 address, so the returned AAAA is unroutable and `relayTCP` (`internal/amneziawgnet/egress.go:383-398`) fails with "network is unreachable". The 60 s family-agnostic cache at `dns.go:72,116-121` then holds the bad answer. Trigger: an AmneziaWG outbound whose `address` is IPv4-only, a dual-stack destination host, and any A-query failure inside the tunnel (a cold handshake is enough). Introduced with the feature itself in d5ab84e8 `feat(amneziawg): add AmneziaWG as an outbound protocol (#6320)`. The secondary path, an IPv6 literal from Xray, is unguarded at `egress.go:361-364`. Already fixed: Still present on the default branch. `git log -- internal/amneziawgnet/dns.go internal/amneziawgnet/egress.go` shows only d5ab84e8 and 3f1e52f0 (`refactor(panel): drop two duplicated helpers`); no behavioural change since. d5ab84e8 is tagged v3.8.0, v3.8.5 and dev-latest. Duplicate of: None. The three AmneziaWG issues that surface on these keywords — #6302, #6303, #6310 — are a feature request, an inbound throughput report and a Clash-subscription omission, all with different root causes. Evidence: `internal/amneziawgnet/dns.go:141-160` (`hasV6` only reorders `types`; the loop tries both families regardless); `internal/amneziawgnet/dns.go:56-58` (`tunnelDNSPacketTimeout = 1200 * time.Millisecond`, `tunnelDNSAttempts = 3` → a 3.6 s A-query budget inside a `tunnelResolveTimeout = 4 * time.Second` context); `internal/amneziawgnet/dns.go:72,77-79,116-121` (60 s cache, key `tag|dnsServer|host`, no family); `internal/amneziawgnet/netstack.go:92-97` (`if hasV6 { AddRoute(IPv6EmptySubnet) }`); `internal/amneziawgnet/client_device.go:101,108,120` (`localAddrs` comes from `inst.Address`, not from peer `AllowedIPs`); `internal/amneziawgnet/egress.go:395` (the exact warning string) and `egress.go:361-364` (literal IPs bypass any family check); `internal/web/service/outbound/probe_http.go:63,451,491-492` (Google probe URL, `domainStrategy: "AsIs"`, domain forwarded to the proxy). No test pins the current behaviour: `deviceHasV6` has exactly one caller (`dns.go:142`), and `internal/amneziawgnet/egress_domain_test.go:650-660` covers only `defaultDNSFor`. UI gap: `frontend/src/pages/xray/outbounds/protocols/amneziawg.tsx:81` vs `frontend/src/pages/inbounds/form/protocols/amneziawg.tsx:134-152`, with backend support at `internal/amneziawg/outbound.go:58-62,152` and `internal/amneziawgnet/client_device.go:35-39`. Not determined: Whether this particular run went through the AAAA fallback or through an IPv6 literal handed over by the reporter's main routing config. A single `XUI_LOG_LEVEL=debug` run showing the `dns.go:122` "resolved … via tunnel" line immediately before the failure settles it. Suggested fix: Gate the second-family retry in `exchangeTunnelDNSWithFallback` on the device actually having that family — skip AAAA when `!deviceHasV6(addrs)` and skip A when `!deviceHasV4(addrs)` — so an unroutable answer is never returned or cached. The literal-IP path at `egress.go:361-364` wants the same one-line family check so an IPv6 literal from Xray fails with a clear reason rather than a dial timeout. @MHSanaei — confirmed High-severity defect in the AmneziaWG outbound egress; root cause and suggested fix above. *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Author
Owner

@AdLf0208 commented on GitHub (Sep 16, 2026):

yep, added I2 to I5 manually but still got issues with ipv6. It seems that since I have ipv6 on my laptop firstly it tries to probe ipv6 on domain google.com
I created a temp socks proxy which would route all trafic through awg outbound and that's the result

curl -4 -x socks5://192.168.1.152:27741 https://google.com

<HTML><HEAD> </HEAD>

301 Moved

The document has moved here. </HTML>

curl -6 -x socks5://192.168.1.152:27741 https://google.com
curl: (35) Recv failure: Connection reset by peer

Although I have a working ipv6 address. So is there a way to configure ipv6 subnet within the ui of 3x-ui?
And also the thing is that even if ipv6 is not properly set up on the server if shouldn't affect the connection: so the fallback mechanism should be in place so the outbound could at least connect to the server

<!-- gh-comment-id:5696490850 --> @AdLf0208 commented on GitHub (Sep 16, 2026): yep, added I2 to I5 manually but still got issues with ipv6. It seems that since I have ipv6 on my laptop firstly it tries to probe ipv6 on domain google.com I created a temp socks proxy which would route all trafic through awg outbound and that's the result curl -4 -x socks5://192.168.1.152:27741 https://google.com <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="https://www.google.com/">here</A>. </BODY></HTML> curl -6 -x socks5://192.168.1.152:27741 https://google.com curl: (35) Recv failure: Connection reset by peer Although I have a working ipv6 address. So is there a way to configure ipv6 subnet within the ui of 3x-ui? And also the thing is that even if ipv6 is not properly set up on the server if shouldn't affect the connection: so the fallback mechanism should be in place so the outbound could at least connect to the server
Author
Owner

@AdLf0208 commented on GitHub (Sep 16, 2026):

Update on the matter: I tried to manually specify the ipv6 address and found out that it never even tried to contact the server via this ipv6 address even ones (checked via tcpdump)

tcpdump -n -i any ip6 dst ... and udp port ...
tcpdump: data link type LINUX_SLL2
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes

So not even one. But ipv4 is successfully being called:

tcpdump -n -i any dst ... and udp port ...
tcpdump: data link type LINUX_SLL2
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes

13:51:45.691843 ens3 In IP ... > ...: UDP, length 531
13:51:45.691942 ens3 In IP ... > ...: UDP, length 210

<!-- gh-comment-id:5696983886 --> @AdLf0208 commented on GitHub (Sep 16, 2026): Update on the matter: I tried to manually specify the ipv6 address and found out that it never even tried to contact the server via this ipv6 address even ones (checked via tcpdump) tcpdump -n -i any ip6 dst ... and udp port ... tcpdump: data link type LINUX_SLL2 tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes So not even one. But ipv4 is successfully being called: tcpdump -n -i any dst ... and udp port ... tcpdump: data link type LINUX_SLL2 tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes 13:51:45.691843 ens3 In IP ... > ...: UDP, length 531 13:51:45.691942 ens3 In IP ... > ...: UDP, length 210
Author
Owner

@AdLf0208 commented on GitHub (Sep 16, 2026):

Okay, maybe ipv6 issue related to the fact that I didn't have like client ipv6 and only ipv4 within the tunnel itself but still every other client app connects as it should without any issues(including keenetic OS routers)

There're no other logs in debug mode, only related to ipv6 probe failure, where to dig deeper in order to debug?

<!-- gh-comment-id:5698074906 --> @AdLf0208 commented on GitHub (Sep 16, 2026): Okay, maybe ipv6 issue related to the fact that I didn't have like client ipv6 and only ipv4 within the tunnel itself but still every other client app connects as it should without any issues(including keenetic OS routers) There're no other logs in debug mode, only related to ipv6 probe failure, where to dig deeper in order to debug?
Author
Owner

@AdLf0208 commented on GitHub (Sep 16, 2026):

I changed dns from 1.1.1.1 to 8.8.8.8 in awg GUI configuration and now everything works!!! That's weird. But there's still an UI issue which needs to be fixed since it's cumbersome to type I2-I5 params via json config instead of GUI outbound interface

<!-- gh-comment-id:5701258385 --> @AdLf0208 commented on GitHub (Sep 16, 2026): I changed dns from 1.1.1.1 to 8.8.8.8 in awg GUI configuration and now everything works!!! That's weird. But there's still an UI issue which needs to be fixed since it's cumbersome to type I2-I5 params via json config instead of GUI outbound interface
bsakaguchi changed title from [GH-ISSUE #6570] [Bug]: Awg outbound can't connect to the server to [GH-ISSUE #6570] [Bug]: Awg outbound can't connect to the server 2026-11-07 20:38:21 +07:00
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#4402
No description provided.