Public bug reported:
Affected: Ubuntu 24.04 (network-manager 1.46.0-1ubuntu2.8, netplan.io
1.1.2-8ubuntu1~24.04.3) and Ubuntu 26.04 (network-manager
1.54.3-2ubuntu3.1, netplan.io 1.2-1ubuntu5.1).
Description: If a WireGuard connection has wireguard.fwmark set, any
update made with nmcli silently drops all of its [wireguard-peer.*]
sections. This happens whatever property is changed (nmcli connection
modify … connection.autoconnect no, or nmcli connection edit + save).
After that, /etc/netplan/90-NM-<uuid>.yaml has no peers:, the generated
/run/NetworkManager/system-connections/netplan-<id>.nmconnection has no
peer section, NetworkManager logs <iface>: at least one peer is
required., and the tunnel comes up with no peer.
Steps to reproduce (in a privileged container):
docker run --rm -it --privileged ubuntu:24.04 bash
apt-get update && apt-get install -y network-manager netplan.io dbus
mkdir -p /run/dbus && dbus-daemon --system --fork
NetworkManager --no-daemon > /tmp/nm.log 2>&1 &
sleep 3
printf '[Interface]\nAddress = 10.88.0.4/32\nFwMark = 51820\n[Peer]\nPublicKey
= Q71Cgpz4nlsH4VhhaOrdblrp/sTQD/ImqZY00PE3+g8=\nEndpoint =
203.0.113.1:51820\nAllowedIPs = 203.0.113.1/32\n' > /tmp/wg0.conf
nmcli connection import type wireguard file /tmp/wg0.conf
grep -A4 'peers:' /etc/netplan/90-NM-*.yaml # the peer is there
nmcli connection modify wg0 connection.autoconnect no
grep -A4 'peers:' /etc/netplan/90-NM-*.yaml # nothing: the peer is gone
grep 'at least one peer' /tmp/nm.log
Expected: the peer is kept, as it is in every control case below.
Controls:
- Without the FwMark line, the peer is kept.
- Table = alone has no effect.
- An unchanged D-Bus Settings.Connection.Update keeps the peer, even with a
fwmark.
- Debian 12 (NetworkManager 1.42, no netplan) keeps the peer with nmcli and a
fwmark.
- In netplan's YAML, the fwmark appears as networkmanager.passthrough:
wireguard.fwmark, so the bug may lie in how passthrough settings interact with
peers on the update path.
Impact: wg-quick-style setups that route the endpoint's own address
through the tunnel need a fwmark to avoid a routing loop. Any such
connection edited with nmcli, or probably with a GUI using libnm,
silently loses its peer and stops working.
** Affects: netplan.io (Ubuntu)
Importance: Undecided
Status: New
** Affects: network-manager (Ubuntu)
Importance: Undecided
Status: New
** Also affects: network-manager (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174386
Title:
WireGuard connection with fwmark loses its peers when updated with
nmcli (netplan-backed NetworkManager)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2174386/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs