bonding
bonding copied to clipboard
Ubuntu 18: support Netplan configuration
The new Ubuntu 18 release uses Netplan (a Canonical invention) to configure networking, as outlined here in these links:
- https://netplan.io/
- http://manpages.ubuntu.com/manpages/bionic/en/man5/netplan.5.html
- https://insights.ubuntu.com/2017/12/01/ubuntu-bionic-netplan
Bonding will require code updates to support writing the YAML, etc.
Sorting out the desired end state, I ran into this shenanigan:
- https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1753431
It's unclear if being required to name the slaves with dummy data to define them is per design, or if it's a bug in implementation. It's enough to set dhcp4: false
on the definition of the slave (which is already the default) to satisfy it's needs.
I also have found that an attempt to install ifenslave
will trigger an install of ifupdown
which is undesirable; unpacking the DEB file and using the script directly works fine, it seems to be a packaging thing. I'm going to engage Canonical about this item under our company login.
Starting configuration - this device has a quad-port NIC, eno1 and eno2 are the bonding pair. The eno3 interface is a secondary network not associated with bonding, however provides a bit of context about the config itself on a real life server.
network:
version: 2
renderer: networkd
ethernets:
eno1:
addresses: [ 172.24.16.188/22 ]
gateway4: 172.24.16.1
nameservers:
search: [ domain.com ]
addresses:
- "8.8.8.8"
- "1.1.1.1"
eno3:
optional: true
addresses: [ 10.132.99.73/27 ]
routes:
- to: 10.191.192.0/18
via: 10.132.99.65
on-link: true
The resulting bonded configuration which works with netplan generate
and netplan apply
on the fly (while logged in over SSH).
network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: false
dhcp6: false
eno2:
dhcp4: false
dhcp6: false
eno3:
optional: true
addresses: [ 10.132.99.73/27 ]
routes:
- to: 10.191.192.0/18
via: 10.132.99.65
on-link: true
bonds:
bond0:
addresses: [ 172.24.16.188/22 ]
gateway4: 172.24.16.1
nameservers:
search: [ domain.com ]
addresses:
- "8.8.8.8"
- "1.1.1.1"
interfaces:
- eno1
- eno2
parameters:
mode: active-backup
mii-monitor-interval: 100
The use of primary: <interface>
is not required in the configuration of the bond.