Prevent Isolated Network From Communicating With Host
Is the best way to prevent hosts in an isolated network from communicating with the host at all to just bring down the network's assigned interface on the host? I just need the VMs in the network to communicate with each other and not be able to communicate with the host whatsoever.
I tried deleting the bridge from the XML file in virsh but it just returned upon the network being brought back up.
Posted May 22, 2021, 9:55 PM UTC · edited
Great advanced question. I hope someone with more knowledge will jump into the conversation here, but I suspect you should go straight to the KVM/qemu and maybe libvirt mailing lists, because that's where the expertise is. Reddit is basically teenager daycare. The days of the top sub being r/programming are long long long gone, and this sub is tiny anyway.
Isolating VMs in qemu/kvm on linux is difficult. The network stack wasn't designed for it, but there's been a lot of work in the last ten years or so to make it better.
I think it's still best practice to use a separate physical network interface for host/hypervisor management. It's just really really hard to isolate the host's bridge interface. If your host has an IP interface on the same bridge VMs are on, there's going to be some crazy way those VMs will be able to mess with it. Just use a separate physical interface.
Making your host system NOT be a router (example: net.ipv4.ip_forward = 0) really helps, but that limits you to certain scenarios.
Personally I hate libvirt's built in network filtering. It's garbage. So I wrote my own scripts via /etc/libvirt/hooks. Unfortunately I can't share that code publicly.
Actually re-reading your post, you sound kind of novice. You need to be putting these VMs into a bridge, and that bridge should be isolated on the hypervisor. You need to learn the brctl command, notably show and showmacs