netplan-everywhere and existing wireguard connections

Bug #2016473 reported by Danilo Egea Gondolfo
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

When creating a wireguard tunnel via Network Manager, a Netplan "nm-device" interface will be created with all the VPN information in the "networkmanager.passthrough" section.

The problem with that is that if you try to make any change to an existing wireguard tunnel connection that was created via Netplan, Network Manager will try to change its type from "tunnels" to "nm-devices" and libnetplan will fail:

Apr 17 09:23:03 yoga NetworkManager[58911]: /etc/netplan/90-wireguard-aws.yaml:3:5: Error in network definition: Updated definition 'wg0' changes device type
Apr 17 09:23:03 yoga NetworkManager[58911]: wg0:
Apr 17 09:23:03 yoga NetworkManager[58911]: ^
Apr 17 09:23:03 yoga NetworkManager[5415]: <info> [1681719783.2161] audit: op="connection-update" uuid="e4589c36-4f47-3af1-96aa-268a68a512cd" name="netplan-wg0" pid=58186 uid=1000 result="success"

In the example above I just tried to unset the connection "autoconnect" option in the GUI interface.

After that, any other change in any other connection will also crash Network Manager because it will try to persist the previous broken change.

In fact, if you have a WG tunnel in Netplan and try to install the network-manager+netplan PPA, the installer will break when trying to run the script to "import" the existing connections to Netplan:

Error: failed to reload connections: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/NetworkManager/Settings”.
dpkg: error processing package network-manager (--configure):
 installed network-manager package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of network-manager-config-connectivity-ubuntu:
 network-manager-config-connectivity-ubuntu depends on network-manager (>= 1.42.4-1ubuntu2+netplan202304060830+229~gitr923fece34~ubuntu23.04.1); however:
  Package network-manager is not configured yet.

Related branches

Lukas Märdian (slyon)
Changed in netplan:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Lukas Märdian (slyon) wrote :
Revision history for this message
Lukas Märdian (slyon) wrote :
Changed in netplan:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.