Setting up a bridged network for HomeAssistant in KVM Fedora
Setting up a bridged network for HomeAssistant in KVM Fedora
cross-posted from: https://mander.xyz/post/16531247
I have tried to follow several tutorial to setup using either
ip
ornmtui
:
- 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 device 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.
That's a configuration problem you've made somewhere: you shouldn't be assigning an IP to the bridge and it's constituent interfaces.
You should take a look at your network config, and run (I'm assuming) dhcp only for br0.
Once you define the bridge network in virsh, and use that to make your VMs, kvm/qemu will assign unique MAC addresses to the VMs, so all you really need to sort out is getting your host OS to only assign an IP for the bridge.
Edit: also checked and yeah, eno2 and br0 and virbr0 are all different MAC addresses; did you maybe pick an option that forces them to inherit a MAC or something?
Hi, thank you for your reply.
Did you make sure that eno2 is enslaved by br0? When br0 is created, it indeed have a unique MAC, but once it enslaves the hardware, it inherits the hardware address.
I have not tried to get the bridge going with virsh, but I was unsuccessful with the virt-manager ui. And I assume they use the same system?
It is possible I have accidentally disabled some network virtualization kernel component during setup, as I have implemented some mods from secureblue. I will try to reset everything to default, and try again.
Do you have a tutorial for making bridge via virsh that you can share.
My nas isn't running fedora and thus isn't using whatever fedora uses for network definitions, but is netplan under ubuntu.
I mean, probably the same thing, but it was shockingly trivial to configure:
Disabled addresses on the physical interface, added the bridge section and told it which interface(s) to bridge - in this case it'd be the real interface and whatever gets added later by qemu/kvm, and then defined the IP address info.
the virsh network xml file was also straightforward, just make a xml file similar to:
and then it's just
Should show up in the net list, and be selectable by name when making a VM