[Bug 2098093] Re: Setting primary interface for a bond fails with netplan
Lukas Märdian
2098093 at bugs.launchpad.net
Thu Apr 3 09:24:20 UTC 2025
** Also affects: netplan
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/2098093
Title:
Setting primary interface for a bond fails with netplan
Status in Netplan:
New
Status in netplan.io package in Ubuntu:
Triaged
Status in network-manager package in Ubuntu:
Confirmed
Bug description:
Ubuntu 2404
network-manager 1.46.0-1ubuntu2.2
netplan.io 1.1.1-1~ubuntu24.04.1
When [improving support for primary interfaces of
bonds](https://github.com/cockpit-project/cockpit/pull/21533) in
Cockpit, we encountered this message in the journal:
```
Feb 10 08:43:17 ubuntu NetworkManager[9361]: /etc/netplan/90-NM-861a710b-9858-48f4-b5e5-a770ab67bd1f.yaml:13:18: Error in network definition: tbond: interface 'cockpit' is not defined
Feb 10 08:43:17 ubuntu NetworkManager[9361]: primary: "cockpit"
Feb 10 08:43:17 ubuntu NetworkManager[9361]: ^
```
The message seems to come from "netplan apply":
```
# netplan apply
[...]
/etc/netplan/90-NM-4883fb46-4315-41f1-b945-bb096768da61.yaml:13:18: Error in network definition: tbond: interface 'cockpit' is not defined
primary: "cockpit"
^
# echo $?
78
```
NetworkManager seems to ignore the failure, and somehow the bond
interface is created anyway, but the "bond.options" setting of its
connection doesn't include the expected "primary" attribute:
```
# nmcli con show tbond | grep ^bond
bond.options: mode=active-backup,downdelay=0,miimon=100,updelay=0
```
I have no idea what the relationship between netplan and
NetworkManager is. I am guessing that NetworkManager is writing the
yaml files in /etc/netplan/.
The problem seems to be that the definition of the "cockpit" interface
uses a generated name:
```
network:
version: 2
ethernets:
NM-3287d9ea-ffda-49df-9f21-27594d7cc1b8:
renderer: NetworkManager
match:
name: "cockpit"
wakeonlan: true
networkmanager:
uuid: "3287d9ea-ffda-49df-9f21-27594d7cc1b8"
name: "cockpit"
passthrough:
connection.controller: "tbond"
connection.master: "tbond"
connection.port-type: "bond"
connection.slave-type: "bond"
ethernet._: ""
```
If I change this to
```
network:
version: 2
ethernets:
cockpit:
renderer: NetworkManager
match:
name: "cockpit"
[...]
```
then the error disappears and `bond.options` shows the expected value:
```
# nmcli con show tbond | grep ^bond
bond.options: mode=active-backup,downdelay=0,miimon=100,primary=cockpit,updelay=0
```
To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/2098093/+subscriptions
More information about the foundations-bugs
mailing list