28.3 Creating a Netplan Network Bridge
The creation of a network bridge on an Ubuntu system using Netplan involves the addition of an entry to the /etc/netplan/01-netcfg.yaml or /etc/netplan/00-installer-config.yaml file. Using your preferred editor, open the file and add a bridges entry beneath the current content as follows (replacing eno1 with the connection name on your system):
network:
ethernets:
eno1:
dhcp4: true
version: 2
bridges:
br0:
interfaces: [eno1]
dhcp4: yes
Note that the bridges: line must be indented by two spaces. Without this indentation, the netplan tool will fail with the following error when run:
Error in network definition: unknown key ‘bridges’
Once the changes have been made, apply them using the following command:
...