I am trying to create two VMs with libvirt which are connected to a linux bridge (my_bridge). I also want that linux bridge to be connected to the physical interface eth0 of the host. Can I do that? According to https://wiki.libvirt.org/page/VirtualNetworking, it should be possible by configuring it this way:
<network>
<name>testing</name>
<forward dev='eth0' mode='nat'/>
<bridge name='my_bridge' stp='on' delay='0'/>
<mac address='52:54:00:e9:8f:a8'/>
<ip address='10.167.8.1' netmask='255.255.255.0'/>
</network>
However, that configuration creates the brige 'my_bridge' but it never connects eth0 to that bridge. Am I doing something wrong
eth0
interface (doing NAT) and its bridge interface (that's the virtual LAN where the VM will be). It never told thateth0
would be put in the bridge.That should probably not be the role of the hypervisor to do this, because it would affect the host. It should be done beforehand by the host OS (or done quite differently by the hypervisor, using macvtap, eg: Bridge vs Macvlan , Some notes on macvlan/macvtap ). – A.B Jul 18 '18 at 17:07