[GH-ISSUE #3107] amn0 interface assigned /32 prefix instead of correct CIDR — no traffic passes (fix in PR #2840 not in 5.0.1.5) #1440

Open
opened 2026-10-14 03:42:31 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @15ags on GitHub (Aug 31, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3107

Describe the bug
The AmneziaVPN client assigns the wrong IPv4 prefix length to the amn0 interface. Instead of assigning the correct CIDR (e.g. /24), it assigns /32, making the interface unusable for routing. All traffic routed through amn0 (0.0.0.0/1 and 128.0.0.0/1) is dropped because the interface has an invalid IP configuration. This is the same bug as #1089, #1647, #2048, which was fixed in PR #2840 but the fix is not present in the latest .run installer (5.0.1.5).
To Reproduce

  1. Install AmneziaVPN via the .run installer
  2. Connect to an AmneziaWG server
  3. Run ip addr show amn0 — see inet x.x.x.x/32 (wrong /32 prefix)
  4. Run ping -c 3 8.8.8.8 — 100% packet loss
  5. Run ip route show — routes go through amn0 but traffic is blackholed
    Expected behavior
    The client should assign the correct CIDR prefix (e.g. /24) to amn0 so that traffic can be routed through the tunnel, as specified in the VPN config Address field.
    Workaround
    After connecting, run manually:
    sudo ip addr del <assigned_ip>/32 dev amn0
    sudo ip addr add <config_ip>/24 dev amn0
    Log files
    AmneziaVPN.log:
    [2026-08-31 16:58:36.275Z] [DEBUG] AmneziaVPN : "Trying to connect to VPN, container is amnezia-awg, route mode is" amnezia::route_mode_ns::VpnOnlyForwardSites
    [2026-08-31 16:58:36.290Z] [DEBUG] AmneziaVPN : "Site split tunneling is disabled, route mode is 0"
    [2026-08-31 16:58:37.153Z] [DEBUG] AmneziaVPN : VpnProtocol::setConnectionState "Connected"
    [2026-08-31 16:58:37.154Z] [DEBUG] AmneziaVPN : Connection state: 'Connected'
    Interface output after connection:
    amn0: <POINTOPOINT,PROMISC,UP,LOWER_UP> mtu 1280
    inet x.x.x.x/32 scope global amn0 ← wrong, should be /24
    Routes:
    0.0.0.0/1 dev amn0 metric 1
    128.0.0.0/1 dev amn0 metric 1
    Desktop:
  • OS: Arch Linux x86_64
  • Version: AmneziaVPN 5.0.1.5 installed via .run
    Server:
  • Protocol: AmneziaWG
    Additional context
    PR #2840 ("fix(linux): preserve IPv4 interface host and prefix") merged Jul 17, 2026 appears to fix this exact issue, but the fix is not included in version 5.0.1.5 available from the .run installer. The bug has been reported in #1089, #1357, #1647, #1731, #2048, #2483, #2573 — all with the same root cause (amn0 gets /32 prefix instead of the correct CIDR). Please include this fix in the next release.
Originally created by @15ags on GitHub (Aug 31, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3107 Describe the bug The AmneziaVPN client assigns the wrong IPv4 prefix length to the amn0 interface. Instead of assigning the correct CIDR (e.g. /24), it assigns /32, making the interface unusable for routing. All traffic routed through amn0 (0.0.0.0/1 and 128.0.0.0/1) is dropped because the interface has an invalid IP configuration. This is the same bug as #1089, #1647, #2048, which was fixed in PR #2840 but the fix is not present in the latest .run installer (5.0.1.5). To Reproduce 1. Install AmneziaVPN via the .run installer 2. Connect to an AmneziaWG server 3. Run ip addr show amn0 — see inet x.x.x.x/32 (wrong /32 prefix) 4. Run ping -c 3 8.8.8.8 — 100% packet loss 5. Run ip route show — routes go through amn0 but traffic is blackholed Expected behavior The client should assign the correct CIDR prefix (e.g. /24) to amn0 so that traffic can be routed through the tunnel, as specified in the VPN config Address field. Workaround After connecting, run manually: sudo ip addr del <assigned_ip>/32 dev amn0 sudo ip addr add <config_ip>/24 dev amn0 Log files AmneziaVPN.log: [2026-08-31 16:58:36.275Z] [DEBUG] AmneziaVPN : "Trying to connect to VPN, container is amnezia-awg, route mode is" amnezia::route_mode_ns::VpnOnlyForwardSites [2026-08-31 16:58:36.290Z] [DEBUG] AmneziaVPN : "Site split tunneling is disabled, route mode is 0" [2026-08-31 16:58:37.153Z] [DEBUG] AmneziaVPN : VpnProtocol::setConnectionState "Connected" [2026-08-31 16:58:37.154Z] [DEBUG] AmneziaVPN : Connection state: 'Connected' Interface output after connection: amn0: <POINTOPOINT,PROMISC,UP,LOWER_UP> mtu 1280 inet x.x.x.x/32 scope global amn0 ← wrong, should be /24 Routes: 0.0.0.0/1 dev amn0 metric 1 128.0.0.0/1 dev amn0 metric 1 Desktop: - OS: Arch Linux x86_64 - Version: AmneziaVPN 5.0.1.5 installed via .run Server: - Protocol: AmneziaWG Additional context PR #2840 ("fix(linux): preserve IPv4 interface host and prefix") merged Jul 17, 2026 appears to fix this exact issue, but the fix is not included in version 5.0.1.5 available from the .run installer. The bug has been reported in #1089, #1357, #1647, #1731, #2048, #2483, #2573 — all with the same root cause (amn0 gets /32 prefix instead of the correct CIDR). Please include this fix in the next release.
Author
Owner

@yepbro commented on GitHub (Nov 1, 2026):

Confirming this is still reproducible in 5.0.3.0 (latest release, .run installer) — the PR #2840 fix still hasn't shipped.

Environment

  • Client: Ubuntu 26.04, AmneziaVPN 5.0.3.0 (linux_x64.run), self-hosted server, AmneziaWG
  • Stored config has Address = 10.8.1.1/32 (single-stack IPv4 — the #3107 variant, not the dual-stack one from #3271)

Symptoms

  • Client connects, handshake completes (server sees the peer endpoint and a fresh handshake), but all traffic is blackholed — no DNS, no pages load.
  • After connect: amn0 has inet 10.8.1.1/32, routes 0.0.0.0/1 and 128.0.0.0/1 dev amn0.

Workaround (same as the report — works instantly):

sudo ip addr del 10.8.1.1/32 dev amn0
sudo ip addr add 10.8.1.1/24 dev amn0

Internet works immediately after. We automated this with a small systemd service that watches for amn0 and rewrites the prefix on every connect.

Side observation (possibly a separate server-side issue): while debugging we saw heavy packet amplification on the server — Docker hairpin MASQUERADE rules (-s <container_ip>/32 -d <container_ip>/32 --dport <awg_udp_port> -j MASQUERADE) plus conntrack cause part of the client's inbound packets to reach the awg container with the source rewritten to the amn0 gateway address (172.29.172.1:port). The peer endpoint then roams to that NAT'd address and the daemon's responses bounce between host and container (800k+ packets / 90s on the veth while the physical NIC only moved ~0.2 GB total). Disabling the userland proxy (userland-proxy: false) did not prevent this. It inflated per-session tx counters by GBs. Might be worth a separate look.

Please consider shipping the #2840 fix in the next release — happy to test a build.

<!-- gh-comment-id:6563420960 --> @yepbro commented on GitHub (Nov 1, 2026): **Confirming this is still reproducible in 5.0.3.0** (latest release, `.run` installer) — the PR #2840 fix still hasn't shipped. **Environment** - Client: Ubuntu 26.04, AmneziaVPN 5.0.3.0 (linux_x64.run), self-hosted server, AmneziaWG - Stored config has `Address = 10.8.1.1/32` (single-stack IPv4 — the #3107 variant, not the dual-stack one from #3271) **Symptoms** - Client connects, handshake completes (server sees the peer endpoint and a fresh handshake), but all traffic is blackholed — no DNS, no pages load. - After connect: `amn0` has `inet 10.8.1.1/32`, routes `0.0.0.0/1` and `128.0.0.0/1` dev amn0. **Workaround** (same as the report — works instantly): ``` sudo ip addr del 10.8.1.1/32 dev amn0 sudo ip addr add 10.8.1.1/24 dev amn0 ``` Internet works immediately after. We automated this with a small systemd service that watches for amn0 and rewrites the prefix on every connect. **Side observation (possibly a separate server-side issue):** while debugging we saw heavy packet amplification on the server — Docker hairpin MASQUERADE rules (`-s <container_ip>/32 -d <container_ip>/32 --dport <awg_udp_port> -j MASQUERADE`) plus conntrack cause part of the client's inbound packets to reach the awg container with the source rewritten to the amn0 gateway address (172.29.172.1:port). The peer endpoint then roams to that NAT'd address and the daemon's responses bounce between host and container (800k+ packets / 90s on the veth while the physical NIC only moved ~0.2 GB total). Disabling the userland proxy (`userland-proxy: false`) did not prevent this. It inflated per-session tx counters by GBs. Might be worth a separate look. Please consider shipping the #2840 fix in the next release — happy to test a build.
Sign in to join this conversation.
No labels
pull-request
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
amnezia-vpn/amnezia-client#1440
No description provided.