Netplan doesn't delete bond interface when removed from config

us flag

I have a working bond config, set via Netplan

Example, netplan config:

      addresses: []
      interfaces: [ens1f0, ens1f1]
        addresses: [,]
      parameters: {mii-monitor-interval: 100, mode: 802.3ad, transmit-hash-policy: layer3+4}
    ens1f0: {dhcp4: false}
    ens1f1: {dhcp4: false}
  version: 2

Then I update Netplan config to no longer use a bond:

    ens1f0: {dhcp4: true}
    ens1f1: {dhcp4: true}
  version: 2

When I apply the netplan config, the individual ethernet interfaces are configured properly, but the bond is not deleted from the system.

I have to manually delete it, ex: ip link delete dev bond0

Why is this? Is there a way to make Netplan apply the config exactly as defined?

sa flag

The issue that you're facing is included by design. See the Known Issues portion of the netplan-apply manpage:

       netplan  apply will not remove virtual devices such as bridges and bonds that have been created,
       even if they are no longer described in the netplan configuration.  That is due to the fact that
       netplan operates statelessly and is not aware of the previously defined virtal devices.

       This  can  be  resolved  by manually removing the virtual device (for example ip link delete dev
       bond0) and then running netplan apply, by rebooting, or by creating a temporary  backup  of  the
       YAML  state in /etc/netplan before modifying the configuration and passing this state to netplan
       (e.g.  mkdir -p /tmp/netplan_state_backup/etc &&  cp  -r  /etc/netplan  /tmp/netplan_state_back‐
       up/etc/ then running netplan apply –state /tmp/netplan_state_backup)

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.