Score:1

Ubuntu server 2020.4 network bridge for KVM not starting

us flag

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.

A.B avatar
cl flag
A.B
Configuration: `enp2s0`, following command: `enp4s0`. Care to explain?
us flag
Thanks for pointing this out ! Fixing the type in the netplan file fixed my problem. Interestingly enough, the netplan generate command seems to lack checking if the interfaces mentioned actually exist.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.