Testing Netplan’s Desktop integration with NetworkManager
Netplan.io is the “single source of truth” for controlling Ubuntu’s network stack, which means you can find all the information about your network configuration in /etc/netplan/
(or using sudo netplan get
) on Ubuntu Server, Ubuntu Cloud images, Ubuntu Core IoT, etc. On Ubuntu Desktop, we deviated a bit from this approach in the past, as NetworkManager instead stored its “keyfile” settings in /etc/NetworkManager/system-connections/
.
This changed in Ubuntu 23.10 “Mantic Minotaur” (the current development release), where NetworkManager is able to feed back information to Netplan’s YAML config (for example a WiFi password that was changed in the settings GUI), through a bidirectional integration where NetworkManager can talk to Netplan and vice versa.
I’d like to ask anybody running Ubuntu Mantic to help testing this new integration!
The Netplan integration will be automatically installed and activated on your system, when running NetworkManager 1.42.4-1ubuntu3
or above.
Note: When upgrading, NetworkManager will automatically create backups of your original keyfiles, stored in /var/lib/NetworkManager/backups/
and convert your connection profiles to Netplan YAML in /etc/netplan/
.
Testing scenarios
Conversion on upgrade/installation
Whenever you add, modify or delete a connection in NetworkManager (e.g. via settings UI, D-Bus API, nmcli, …) it will be reflected in Netplan’s YAML configuration (i.e. sudo netplan get
).
So after installation/upgrade, you should check the contents of /etc/netplan/90-NM-*.yaml
and verify everything is properly converted into /run/NetworkManager/system-connections/
and properly visible in NetworkManager’s GUI, while /etc/NetworkManager/system-connections/
stays empty.
Ethernet connections
Check /etc/netplan
for a .yaml
file that already contains an ethernet connection and remove it. Then connect your system to a ethernet link via NetworkManager and check for the corresponding YAML to be created and make sure the contents look correct.
$ grep -ri ethernet /etc/netplan
/etc/netplan/90-NM-1b0dfe3a-2815-36aa-8e48-f883bbf16829.yaml: ethernets:
/etc/netplan/90-NM-1b0dfe3a-2815-36aa-8e48-f883bbf16829.yaml: ethernet._: ""
$ rm /etc/netplan/90-NM-1b0dfe3a-2815-36aa-8e48-f883bbf16829.yaml
## Plug into ethernet
$ cat /etc/netplan/90-NM-1b0dfe3a-2815-36aa-8e48-f883bbf16829.yaml
network:
version: 2
ethernets:
NM-1b0dfe3a-2815-36aa-8e48-f883bbf16829:
renderer: NetworkManager
match:
name: "enp0s31f6"
dhcp4: true
dhcp6: true
ipv6-address-generation: "stable-privacy"
wakeonlan: true
networkmanager:
uuid: "1b0dfe3a-2815-36aa-8e48-f883bbf16829"
name: "Wired connection 1"
passthrough:
connection.autoconnect-priority: "-999"
connection.timestamp: "1662490134"
ethernet._: ""
ipv6.ip6-privacy: "-1"
proxy._: ""
.nmmeta.nm-generated: "true"
WiFi connection
Using nmcli
, create a new connection and look for an equivalent change under /etc/netplan/
$ nmcli con add con-name wifi1 type wifi ifname wifi1 ipv4.method manual ipv4.address 10.10.10.4/24 ipv4.gateway 10.10.10.1 ssid <ssid_name>
## should show your new wifi connection
$ nmcli con show
NAME UUID TYPE DEVICE
XXXXX dffebd3b-f21e-4e0f-9ca0-59667d6ac3ac wifi wlp1s0
XXXXX ac0346ad-08f0-48d6-a071-11c7631d4374 wifi --
wifi1 f7adb62a-8088-4270-ac09-10755064cbb3 wifi --
## Note there is a 90-NM-dffebd3.. for another wifi network that I've connected to
$ ls -l /etc/netplan
total 12
-rw-r--r-- 1 root root 104 Apr 19 04:09 01-network-manager-all.yaml
-rw-r--r-- 1 root root 705 Sep 14 16:43 90-NM-dffebd3b-f21e-4e0f-9ca0-59667d6ac3ac.yaml
-rw-r--r-- 1 root root 676 Sep 12 15:28 90-NM-f7adb62a-8088-4270-ac09-10755064cbb3.yaml
See the new YAML file listed and open it up to look and make sure it looks correct
$ cat /etc/netplan/90-NM-f7adb62a-8088-4270-ac09-10755064cbb3.yaml
network:
version: 2
wifis:
NM-f7adb62a-8088-4270-ac09-10755064cbb3:
renderer: NetworkManager
match:
name: "wifi1"
addresses:
- "10.10.10.4/24"
dhcp6: true
ipv6-address-generation: "stable-privacy"
access-points:
"<ssid_name>":
networkmanager:
uuid: "f7adb62a-8088-4270-ac09-10755064cbb3"
name: "wifi1"
passthrough:
ipv4.address1: "10.10.10.4/24,10.10.10.1"
ipv4.method: "manual"
ipv6.ip6-privacy: "-1"
proxy._: ""
networkmanager:
uuid: "f7adb62a-8088-4270-ac09-10755064cbb3"
name: "wifi1"
Insipration for further testing
In addition to standard WiFi and ethernet connections, we’d like to ask the community to test a wide variety of networking setups, as we cannot reproduce all the different setups that any of you might encounter in their daily lifes. Including, but not limited to:
- Enterprise WiFi (e.g. eduroam)
- WWAN (gsm/cdma modem connections)
- WiFi AP mode (Fat, Fit, Cloud - and switching between them)
- Different types of VPN connections (IPSec, WireGuard, VPNC, …)
- Composite devices, like bridges or bonds
- Virtual VLAN and Tunnel devices
- DHCP address assignment (both IPv4 and IPv6)
- Static IP assignment (both IPv4 and IPv6)
- Shared network connectivity, e.g. a connection created with:
nmcli c add con-name shared type ethernet ifname enx000ec6e241bf ipv4.method shared ipv6.method ignore
Feedback
Please let us know about your experience using the Netplan desktop integration of NetworkManager. Be it positive or negative, your feedback is highly appreciated!
Please don’t hesitate to open a bug report and try to describe the setup you’ve been testing in detail and present any problems that might have occurred.
References
Please see Netplan’s documentation and this post for our previous, PPA based work: