Failed to add connection via nmcli
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netplan |
Fix Released
|
Medium
|
Unassigned |
Bug Description
As part of the call for testing NetworkManager YAML: https:/
I have NetworkManager (1.36.6-
I attempted to add the eduroam wifi connection on our campus using the below nmcli command:
nmcli connection add con-name eduroam type wifi ssid eduroam wifi-sec.key-mgmt wpa-eap 802-1x.eap peap 802-1x.identity <email address hidden> 802-1x.password testing123 802-1x.phase2-auth mschapv2 802-1x.ca-cert /home/user/
However, I simply receive the following error:
Error: Failed to add 'eduroam' connection: failure adding connection: settings plugin does not support adding connections
This same command works on another device running Ubuntu 22.04.2 with the standard NetworkManager package from the stable repos (1.36.6-0ubuntu2)
Although the command fails with an error, a netplan yaml file is still created. However, the connection never appears in nmcli output.
Related branches
- Lukas Märdian: Approve
- Sebastien Bacher: Pending requested
-
Diff: 514 lines (+317/-31)3 files modifieddebian/tests/control (+1/-1)
debian/tests/nm.py (+173/-20)
debian/tests/nm_netplan.py (+143/-10)
- Lukas Märdian: Approve
-
Diff: 106 lines (+63/-4)1 file modifieddebian/tests/nm_netplan.py (+63/-4)
tags: | added: netplan-everywhere |
Changed in netplan: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in netplan: | |
status: | Triaged → In Progress |
Changed in netplan: | |
status: | In Progress → Fix Committed |
Changed in netplan: | |
status: | Fix Committed → Fix Released |
Ok, I think I see what's going on.
The keyfile created by Network Manager has the following configuration:
[802-1x]
eap=peap;
When we parse the keyfile to emit Netplan YAML, this setting will become:
networkmanager:
passthrough:
802-1x.eap: "peap;"
Because it's a "networkmanager .passthrough" setting, we don't really interpret it. And because of that, the authentication method will be NETPLAN_ AUTH_EAP_ NONE in the Netplan state.
As we check if the method is not NONE, we end up not writing the auth parameters to the keyfile: https:/ /github. com/canonical/ netplan/ blob/main/ src/nm. c#L450
Adding the key "auth.method:"peap" to the YAML file manually will make Netplan emit the auth configuration:
[wifi-security]
key-mgmt=wpa-eap
-psk=testing123
[802-1x] testing123 /user/. config/ cat_installer/ ca.pem auth=mschapv2
-#Netplan: passthrough setting
+#Netplan: passthrough override
eap=peap;
+<email address hidden>
+password=
+ca-cert=
+phase2-
The reason we are not properly parsing the method appears to be the trailing ";" in the configuration emitted by Network Manager. The field is a list of string separated by ";" but we currently parse it as only one scalar value.
Because of the ";", we don't find the proper method and this setting end up in the passthrough block: https:/ /github. com/canonical/ netplan/ blob/main/ src/parse- nm.c#L358