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.
/etc/netplan/01-networkmanger-all.yaml
network:
version: 2
renderer: NetworkManager
Create a new configuration file "br0". Note: you can set this as static if you want.
/etc/network/interfaces.d/br0
## DHCP config file for br0 ##
auto br0
iface br0 inet dhcp
bridge_ports eno1
TERMINAL:
$ sudo systemctl restart networking
$ ip address
Output:
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 192.168.1.14/24 brd 192.168.1.255 scope global dynamic br0
valid_lft 2534sec preferred_lft 2534sec
$ brctl show
Output:
bridge name bridge id STP enabled interfaces
br0 8000.bxxxxxxxxxx no eno1
Configure Libvirt:
- Open Virtual Machine Manger
- Edit > Connection Details
- Select the "Virtual Networks Tab"
- Click " + " to create a new network
Name: br0 - Select XML Tab
<network connections="1">
<name>br0</name>
<forward mode="bridge"/>
<bridge name="br0"/>
</network>
- Click Apply (a uuid tag should self generate)
- Click the play button lower left to activate the network
- Select VM and click open
- Select NIC :xx:xx:xx
- Change network source to: Virtual network 'br0' : Bridge network
- Boot VM
Finally ping from host to guest
If you find any differences, let me know and I will update this.