I am on a Ubuntu 22.04.5 LTS server. I am trying to setup a virtual bridge with a bond as a slave using netplan. I am used to nmcli, and I know how to do it using nmcli, but netplan trumps nmcli. My bond has already been setup. Now I need to add a bridge to my netplan yaml file. How do I do this?
Example documentaiton on how to do this is detailed in Netplan Documentation How to configure a VM host with bonded network interfaces and three VLANs. Based off of that example, it shows that you can simply add the bond as an interface to the bridge.
A basic Netplan YAML file for two interfaces configured together as a bond, which is added to a bridge as an interface would be as follows:
Obviously, this was setup with DHCP IP addressing, but adjusting to define a static IP is straight forward. Simply define a static IP for the bridge as follows. Adjust your IP address and network settings accordingly.
After configuration, run
sudo netplan apply
to apply the configuration.Then run
ip a
to see the output: