I’m in the process of updating my KVM servers from Ubuntu 18.04 to Ubuntu 20.04. Along with the new version of Ubuntu there’s been some changes in netplan.
What I’ve done is edit the default file created after the Ubuntu Server installation /etc/netplan/00-installer-config.yaml
and setup the following:
network: bonds: bond0: interfaces: - eno1 - eno2 parameters: mode: active-backup ethernets: eno1: {} eno2: {} version: 2 bridges: br0: dhcp4: true interfaces: - bond0 mtu: 1500 parameters: stp: false forward-delay: 4
This has my two interfaces eno1
and eno2
and created bond0
as an active backup. There’s a few different networking modes you can chose from:
Bond Mode | Description |
balance-rr | Round robin network configuration. Packets are send in sequential order from the first connection listed, going down the chain |
active-backup | Only the first connection is used, unless it fails, in which case another connection is used |
balance-xor | This uses a transmission policy to route between interfaces and provides both load balancing and fault tolerance |
broadcast | Not sure why you’d use this – sends data on all interfaces |
802.3ad | This is an IEEE standard. It does require switches to support the same protocol. This mode aggregates the connection to provide the benefit of bandwidth from all configured interfaces. |
balance-tlb | Manages load between the the network adapters based on demand and availability |
balance-alb | Includes both transmission load balancing (balance-tlb) and receive load balancing. |
Then, the bridge br0
connects to bond0
. This is where you configure the network type – DHCP or static IP. In this case I’m using DHCP as the firewall I have in place manages IP address assignments and it has the server set to a static address. If you want to specify a static IP address in this configuration file, you can do it like below:
network: bonds: bond0: interfaces: - eno1 - eno2 parameters: mode: active-backup ethernets: eno1: {} eno2: {} version: 2 bridges: br0: addresses: - 192.168.10.30/24 dhcp4: false gateway4: 192.168.10.1 nameservers: addresses: - 192.168.10.1 - 192.168.10.2 search: [] interfaces: - bond0
You can find out more information here:
https://netplan.io/examples
There’s a version of this post for 18.04 here (see the comments with suggested fixes):
https://www.aptgetlife.co.uk/setting-up-a-bond-and-bridge-in-netplan-on-ubuntu-18-04/