Public bug reported:

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
```

** 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/2098093

Title:
  Setting primary interface for a bond fails with netplan

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/2098093/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to