Add your user to the libvirt and libvirt-qemu groups so you can connect to libvirt using virt-manager without being root
adduser devon libvirt
adduser devon libvirt-qemu
Configure the ethernet adapter and setup a bridge using netplan
The Ethernet adapter will be joined to a bridge device named br0
When setting up a bridge, the bridge (br0) gets the IP address.
All of our virtual machines will use the bridge (br0) as their network interface.
#### Remove all existing netplans##mkdir /etc/netplan.old
mv /etc/netplan/* /etc/netplan.old/
#### Create a new netplan with a static IP and bridge##cat<<EOF > /etc/netplan/00-network.yaml
network:
version: 2
renderer: networkd
ethernets:
ens33:
match:
macaddress: 18:a9:05:25:47:48
set-name: ens33
bridges:
br0:
dhcp4: no
dhcp6: no
addresses:
- 10.10.30.30/16
gateway4: 10.10.10.1
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
interfaces:
- ens33
EOF
#### Apply the netplan configuration#### WARNING: If the IP address changes and you are connected via ssh## you will lose access to the host and need to reconnect## using the new IP address.##
netplan apply
OPTIONAL: Remove the NAT network
Libvirt comes with a default network (192.168.122.0/24) which provides a NAT gateway.
However, it may be decided that the NAT network is unwanted overhead and that all of the VM’s should have direct network access using the bridge (br0), in which case the default NAT network is unwanted.