I'm attempting to configure a bridge to be used for a KVM host on Ubuntu 2020.4 LTS. The basic configuration with netplan works, but the bridge does not work until I manually add the ethernet interface to the bridge with brctl
. But when doing that the connection becomes flaky and eventually stops. How can I have this start up automatically when booting ? What is wrong to make my connectivity go away after adding the interface to the bridge ?
The netplan file:
root@altair:~# cat /etc/netplan/01-ethernet.yaml
# This is the network config written by 'subiquity'
network:
version: 2
ethernets:
enp2s0:
dhcp4: false
dhcp6: false
# addresses: [192.168.15.28/24]
# gateway4: 192.168.15.1
# mtu: 1500
# nameservers:
# addresses: [192.168.15.1]
bridges:
br0:
interfaces: [ enp2s0 ]
addresses: [192.168.15.28/24]
gateway4: 192.168.15.1
mtu: 1500
nameservers:
addresses: [192.168.15.1]
parameters:
stp: true
forward-delay: 4
dhcp4: no
dhcp6: no
The bridge status is emtpy after boot, using the brctl command I can add the ethernet interface manually:
root@altair:~# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 yes
root@altair:~# brctl addif br0 enp4s0
root@altair:~# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.50e5494e2dd1 yes enp4s0
Also when running the brctl
command, after a while my connection hangs and I can only recover it by running ifctl delif br0 enp4s0
.