After having been working for a couple of ages networking suddenly stopped. I spend one afternoon with deepseek to set bridge networking up but after a restart it suddenly decide not to work.
Are these resource still current: https://www.linux-kvm.org/page/Networking, KVM Network Configuration ? As a search is useless as this has apparently been changing so many times I’m just looking for the definitive (2026) guide to setup qemu kvm with a network bridge in which the VMs can access the internet but the host (a laptop with wired ethernet) does not have to have access.
#!/bin/bash
case "$1" in
on)
echo "Enabling KVM bridge mode..."
sudo nmcli connection up bridge-eth0
sudo nmcli connection up kvm-bridge
echo "Bridge active. Your VMs can now use kvm-br0"
;;
off)
echo "Disabling KVM bridge mode..."
sudo nmcli connection down kvm-bridge
sudo nmcli connection down bridge-eth0
echo "Bridge disabled. Back to Wi-Fi mode"
;;
status)
if nmcli connection show --active | grep -q kvm-bridge; then
echo "KVM bridge is ACTIVE (Ethernet in use)"
else
echo "KVM bridge is INACTIVE (Wi-Fi in use)"
fi
;;
*)
echo "Usage: $0 {on|off|status}"
exit 1
;;
esac
If you want to set up a bridged network you need to create the bridge outside kvm and libvirt. The google search would be for “set up bridge network with NetworkManager”.
libvirt will then recognize the bridge and you can set up a bridged connection instead of the default NAT configuration.
Notice, bridged network doesn’t work with wifi, so I’ve read.
If using multiple VMs and each needs the bridged access then you should create a separate bridge device for each of the VMs to avoid issues. Each of the bridge devices should get its own IP for the LAN.
I guess I was relating that to the way multiple IPs were created on a single interface in the past, before NM and assignable MACs were used.
This old fogie is not 100% used to the way interfaces and bridges work now. Too much newfangled tech for me to stay 100% on top of everything.
I should have known better since my VMs each create a discrete vnet when running and all are linked to the virbr0 device.