[GH-ISSUE #1551] Split tunneling doesnt work on Linux with AmneziaWG (Self-hosted VPN) #646

Open
opened 2026-10-14 03:25:49 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @hacker-hackman on GitHub (Apr 25, 2025).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/1551

Describe the bug
When using the AmneziaWG protocol on Linux with Self-hosted VPN, the split tunneling feature is not functioning properly:

  • When I select the option Only the sites listed here will be accessed through the VPN, the VPN doesn't work at all.
  • When I select Addresses from the list should not be accessed via VPN, the VPN applies to all sites, completely ignoring my excluded sites list.

Steps to Reproduce

  1. Select "Self-hosted VPN" on the welcome screen
  2. Enter your credentials and click "Continue"
  3. After installation completes, go to Settings > Connection > Site-based split tunneling
  4. Select Only the sites listed here will be accessed through the VPN, add several sites to the list, and enable the "Split tunneling" switch
  5. Click "Connect" and open your browser to verify that the VPN doesn't work at all
  6. Repeat steps 3-5 but select Addresses from the list should not be accessed via VPN to verify that the VPN affects every site, including those on your blacklist

Expected behavior

  • When Only the sites listed here will be accessed through the VPN is selected and split tunneling is enabled: only sites on my list should use the VPN connection
  • When Addresses from the list should not be accessed via VPN is selected and split tunneling is enabled: all sites except those on my excluded list should use the VPN connection

Desktop (please complete the following information):

  • OS: Linux Mint 21.3
  • Amnezia Version: 4.8.5.0

Server (please complete the following information):

  • OS: Debian 12 (bookworm)
Originally created by @hacker-hackman on GitHub (Apr 25, 2025). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/1551 **Describe the bug** When using the `AmneziaWG` protocol on Linux with `Self-hosted VPN`, the split tunneling feature is not functioning properly: - When I select the option `Only the sites listed here will be accessed through the VPN`, the VPN doesn't work at all. - When I select `Addresses from the list should not be accessed via VPN`, the VPN applies to all sites, completely ignoring my excluded sites list. **Steps to Reproduce** 1. Select "Self-hosted VPN" on the welcome screen 2. Enter your credentials and click "Continue" 3. After installation completes, go to Settings > Connection > Site-based split tunneling 4. Select `Only the sites listed here will be accessed through the VPN`, add several sites to the list, and enable the "Split tunneling" switch 5. Click "Connect" and open your browser to verify that the VPN doesn't work at all 6. Repeat steps 3-5 but select `Addresses from the list should not be accessed via VPN` to verify that the VPN affects every site, including those on your blacklist **Expected behavior** - When `Only the sites listed here will be accessed through the VPN` is selected and split tunneling is enabled: only sites on my list should use the VPN connection - When `Addresses from the list should not be accessed via VPN` is selected and split tunneling is enabled: all sites except those on my excluded list should use the VPN connection **Desktop (please complete the following information):** - OS: Linux Mint 21.3 - Amnezia Version: 4.8.5.0 **Server (please complete the following information):** - OS: Debian 12 (bookworm)
Author
Owner

@jhaoda commented on GitHub (Aug 28, 2025):

Same on 4.8.10.0

<!-- gh-comment-id:3232823770 --> @jhaoda commented on GitHub (Aug 28, 2025): Same on 4.8.10.0
Author
Owner

@volodchenkov commented on GitHub (Apr 13, 2026):

The same on Kubuntu 25.10 with client 4.8.14.5. Server on Ubuntu 22.04.

<!-- gh-comment-id:4239833131 --> @volodchenkov commented on GitHub (Apr 13, 2026): The same on Kubuntu 25.10 with client 4.8.14.5. Server on Ubuntu 22.04.
Author
Owner

@highlander-ekb commented on GitHub (Aug 29, 2026):

I can reproduce this on Kubuntu 24.04 with AmneziaVPN 5.0.1.5 and self-hosted AmneziaWG.

Site split tunneling mode: “Addresses from the list should not be accessed via VPN”.

Added web.max.ru. The new client correctly resolves all current IPv4 addresses:

155.212.204.78
155.212.204.193
155.212.204.143

However, all of them are still routed through the VPN:

$ ip route get 155.212.204.78
155.212.204.78 dev amn0 src 10.8.1.6

$ ip route get 155.212.204.193
155.212.204.193 dev amn0 src 10.8.1.6

$ ip route get 155.212.204.143
155.212.204.143 dev amn0 src 10.8.1.6

ip rule show contains only the default local/main/default rules, and there are no corresponding bypass routes in ip route show table all.

So in 5.0.1.5 the hostname resolution appears improved, but the actual site exclusion is still not applied on Linux.

<!-- gh-comment-id:5460588612 --> @highlander-ekb commented on GitHub (Aug 29, 2026): I can reproduce this on Kubuntu 24.04 with AmneziaVPN 5.0.1.5 and self-hosted AmneziaWG. Site split tunneling mode: “Addresses from the list should not be accessed via VPN”. Added web.max.ru. The new client correctly resolves all current IPv4 addresses: 155.212.204.78 155.212.204.193 155.212.204.143 However, all of them are still routed through the VPN: $ ip route get 155.212.204.78 155.212.204.78 dev amn0 src 10.8.1.6 $ ip route get 155.212.204.193 155.212.204.193 dev amn0 src 10.8.1.6 $ ip route get 155.212.204.143 155.212.204.143 dev amn0 src 10.8.1.6 ip rule show contains only the default local/main/default rules, and there are no corresponding bypass routes in ip route show table all. So in 5.0.1.5 the hostname resolution appears improved, but the actual site exclusion is still not applied on Linux.
Author
Owner

@EnderDremurr commented on GitHub (Oct 27, 2026):

+1, Amnezia 5.0.3.0, still doesn't work
EndeavourOS 7.2.11-zen1-1-zen

<!-- gh-comment-id:6449722122 --> @EnderDremurr commented on GitHub (Oct 27, 2026): +1, Amnezia 5.0.3.0, still doesn't work EndeavourOS 7.2.11-zen1-1-zen
Author
Owner

@aitchtee commented on GitHub (Oct 28, 2026):

Still reproducible on AmneziaVPN 5.0.3.0, Fedora 43 (kernel 7.2), self-hosted AmneziaWG (amnezia-awg2).

Mode: "Addresses from the list should not be accessed via VPN", split tunneling enabled, ~100 entries in the list, kill switch off.

What I observe: after a clean reconnect on AmneziaWG the client adds no exclusion routes at all. The only route via the LAN gateway is the endpoint route to the server; everything else goes through the full tunnel (0.0.0.0/1 + 128.0.0.0/1 dev amn0), including the entries from the list:

Entry in list Resolved IP ip route get
ozon.ru / ozon.com 185.73.193.68 dev amn0
api.ozon.ru 185.73.193.69 dev amn0
rzd.ru / pass.rzd.ru / ticket.rzd.ru 212.164.138.120 dev amn0
my.rzd.ru 217.175.155.159 dev amn0
web.max.ru 155.212.204.143 dev amn0

The GUI shows the IPs for ozon.ru as resolved (185.73.194.82, 185.73.193.68), but no route is created for them.

This matches the analysis in #3314: the split-tunneling block in client/vpnConnection.cpp is skipped for AWG/WireGuard containers, so the site list is not applied at all.

Side observation: after a short session on XRay (same server), ~89 /24 bypass routes were present and stayed in the table after switching back to AmneziaWG. They seem to be leftovers that were not cleaned up on disconnect; they disappeared after a reconnect.

Workaround (in case it helps others): add the routes yourself with a NetworkManager dispatcher script, /etc/NetworkManager/dispatcher.d/90-bypass-vpn (root, 755):

#!/bin/sh
IFACE="$1"; ACTION="$2"
NETS="185.73.192.0/22 212.164.138.0/24 212.164.140.0/24 217.175.128.0/19"
[ "$(nmcli -g GENERAL.TYPE device show "$IFACE" 2>/dev/null)" = "wifi" ] || exit 0
case "$ACTION" in
    up|dhcp4-change)
        [ -n "$IP4_GATEWAY" ] || exit 0
        for net in $NETS; do ip route replace "$net" via "$IP4_GATEWAY" dev "$IFACE"; done ;;
esac

With it, the traffic for these sites goes through wlp1s0, everything else still goes through amn0. Note: this does not work with the kill switch enabled — its firewall drops the non-tunnel traffic.

Edit: an earlier version of this comment said the list was applied "partially". That was wrong: the extra routes were leftovers from the XRay session.

<!-- gh-comment-id:6473053826 --> @aitchtee commented on GitHub (Oct 28, 2026): Still reproducible on **AmneziaVPN 5.0.3.0**, Fedora 43 (kernel 7.2), self-hosted AmneziaWG (`amnezia-awg2`). Mode: **"Addresses from the list should not be accessed via VPN"**, split tunneling enabled, ~100 entries in the list, kill switch off. **What I observe:** after a clean reconnect on AmneziaWG the client adds **no exclusion routes at all**. The only route via the LAN gateway is the endpoint route to the server; everything else goes through the full tunnel (`0.0.0.0/1` + `128.0.0.0/1 dev amn0`), including the entries from the list: | Entry in list | Resolved IP | `ip route get` | |---|---|---| | ozon.ru / ozon.com | 185.73.193.68 | `dev amn0` | | api.ozon.ru | 185.73.193.69 | `dev amn0` | | rzd.ru / pass.rzd.ru / ticket.rzd.ru | 212.164.138.120 | `dev amn0` | | my.rzd.ru | 217.175.155.159 | `dev amn0` | | web.max.ru | 155.212.204.143 | `dev amn0` | The GUI shows the IPs for `ozon.ru` as resolved (`185.73.194.82, 185.73.193.68`), but no route is created for them. This matches the analysis in #3314: the split-tunneling block in `client/vpnConnection.cpp` is skipped for AWG/WireGuard containers, so the site list is not applied at all. Side observation: after a short session on XRay (same server), ~89 `/24` bypass routes were present and stayed in the table after switching back to AmneziaWG. They seem to be leftovers that were not cleaned up on disconnect; they disappeared after a reconnect. **Workaround** (in case it helps others): add the routes yourself with a NetworkManager dispatcher script, `/etc/NetworkManager/dispatcher.d/90-bypass-vpn` (root, 755): ```sh #!/bin/sh IFACE="$1"; ACTION="$2" NETS="185.73.192.0/22 212.164.138.0/24 212.164.140.0/24 217.175.128.0/19" [ "$(nmcli -g GENERAL.TYPE device show "$IFACE" 2>/dev/null)" = "wifi" ] || exit 0 case "$ACTION" in up|dhcp4-change) [ -n "$IP4_GATEWAY" ] || exit 0 for net in $NETS; do ip route replace "$net" via "$IP4_GATEWAY" dev "$IFACE"; done ;; esac ``` With it, the traffic for these sites goes through `wlp1s0`, everything else still goes through `amn0`. Note: this does not work with the kill switch enabled — its firewall drops the non-tunnel traffic. _Edit: an earlier version of this comment said the list was applied "partially". That was wrong: the extra routes were leftovers from the XRay session._
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#646
No description provided.