Linux – Blocking VM’s network temorarily from host machine in KVM

kvm-virtualizationlinuxnetworkingvirtual-machines

I am trying to perform few changes to a running VM's MAC address and obtain new IP address. Currently the VMs are connected to the outside network through the host's bridge interface. I would like to temporarily (10-20 seconds) block the VM's network connection from the host machine except for the packets relating to dhcp.

Is it possible?

Best Answer

Sure, you can either disconnect the VM from the host network, or just apply relevant iptables or ebtables rules to block packets from going anywhere.

Without more details of how your network is setup, it's impossible to give you more detailed commands, but they're all basic administrative tasks.