Setting up a macvtap bridge to a vm

Create the following file, macvtap.xml.

<network>
  <name>macvtap-bridge</name>
  <forward mode="bridge">
    <interface dev="bond0"/>
  </forward>
</network>

Note the host can’t communicate with the guest using macvtap. The trick is to attach this macvtap-bridge network AFTER the default bridge network.

virsh net-define /notes/libvirtd/macvtap.xml
virsh net-autostart macvtap-bridge
virsh net-start macvtap-bridge
virsh attach-interface vm-name network macvtap-bridge --current
virsh edit vm-name      # to remove other nw interface

References