Setting up a bridged network for HomeAssistant in KVM Fedora
Setting up a bridged network for HomeAssistant in KVM Fedora
I have tried to follow several tutorial to setup using either ip
or nmtui
:
- https://linuxconfig.org/how-to-use-bridged-networking-with-libvirt-and-kvm
- https://www.redhat.com/sysadmin/setup-network-bridge-VM
However, the bridge inherits the MAC address of host after enslaving the host hardware enp1s0...
. This causes my router to give both the host and the bridge the same ip address, making the ha instance inaccessible.
The red hat tutorial clearly show that the bridge and the host have different IP, so I was wondering if I am doing something wrong.
alternatively, I can set the home assistant vm to run in NAT and port forward from host, but I have several devices that communicate over different ports. So it would be annoying to forward all these ports. Not to mention, many appliances don't have documentation about the ports they use.
I can also potentially use virtualbox, but it is not well supported on silverblue, especially with secureboot enabled.
I haven't made a bridge to a VM before today, or made a bridge with Network Manager. That being said, I was able to persuade Network Manger to get a bridge working, and there are a few things I can note:
ip link | grep 'master br0'
on the host, and it should display 2 interfaces which are slaves to br0. One for the physical ethernet interface, one for the VM (vnet). And it should only list your ethernet interface when the VM is off.I had a lot of problems getting Network Manager to actually use my ethernet interface as a slave for the bridge. Here's what worked for me, though:
After that, I can go into "Virtual Machine Manger", set my VM's NIC's Network Source to "Bridge device...", Device name to"br0", boot my VM, login to my VM, configure my VM's ip address. And then I can connect to the VM's IP address from the physical ethernet network.