Create Network Bridge For Libvirt

This was a huge challenge that I spent 16+ hours on. I want to help the next person not jump down the rabbit hole. This might be a known problem, but I found postings in most forums to be incomplete, out dated, or miss leading.

Summary: Creating a network bridge for Libvirt in Ubuntu Mate 19.10.

Purpose: Default virtual network for Libvirt is NAT network. The MACvTap bridge does not allow host to guest communication, but will allow other local network devices to communicate to the VM. A bridge will fix this issue.

From my experience, netplan and network manager is broken in 19.10, when it comes to setting up bridging. I have created a bridge with the GUI of NM, the terminal using nmcli, and with a netplan Yaml file. I think this is a netplan issue more then a network manager one.

Ubuntu 20.04 is due out very soon and I can only hope this is fixed by the Ubuntu netplan team. It seems to work in Redhat and CentOS from the videos I have seen. I attempted to follow several examples and guides all with the same result.

Issue: Bridge connection will not activate. You will get a message of waiting on slave. When you bring up the slave you will receive an unknown error. br0 will have a status of "getting IP Address" and never come up. I had to find the "Old way" of configuring to get this to work. :slight_smile:


  version: 2
  renderer: NetworkManager

Create a new configuration file "br0". Note: you can set this as static if you want.


## DHCP config file for br0 ##

auto br0
iface br0 inet dhcp
          bridge_ports eno1


$ sudo systemctl restart networking
$ ip address


br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue  state UP group default qlen 1000
    link/ether xx:xx:xx:dd:cc:bb brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic br0
       valid_lft 2534sec preferred_lft 2534sec

$ brctl show


bridge name	       bridge id	               	STP enabled	interfaces
br0		          8000.bxxxxxxxxxx	               no		eno1

Configure Libvirt:

  1. Open Virtual Machine Manger
  2. Edit > Connection Details
  3. Select the "Virtual Networks Tab"
  4. Click " + " to create a new network
    Name: br0
  5. Select XML Tab

<network connections="1">
<forward mode="bridge"/>
<bridge name="br0"/>

  1. Click Apply (a uuid tag should self generate)
  2. Click the play button lower left to activate the network
  3. Select VM and click open
  4. Select NIC :xx:xx:xx
  5. Change network source to: Virtual network 'br0' : Bridge network
  6. Boot VM

Finally ping from host to guest

If you find any differences, let me know and I will update this.

1 Like