Configuring a MacVTap interface

Configure network interfaces, such as Ethernet interfaces, bonded interfaces, virtual LANs, through a direct MacVTap interface.

Procedure

You configure a network interface as direct MacVTap connection by using the interface element (see <interface>).

Libvirt automatically creates a MacVTap interface when you define the network device.



By default, the virtual server cannot change its assigned MAC address and, as a result, cannot join multicast groups. To enable multicasting, you need set the interface trustGuestRxFilters attribute to yes. This has security implications, because it allows the virtual server to change its MAC address and thus to receive all frames delivered to this address.

  1. Optional: Specify a freely selectable Media Access Control (MAC) address for the virtual server's virtual NIC.


    (see <mac>)

    If you do not specify the mac address attribute, libvirt assigns a MAC address to the interface.

  2. Specify the host network interface.

    To allow virtual server migration to another host, ensure that an interface with the chosen name is configured on both the source and destination host.



    (see <source> as child element of <interface>)
  3. Specify the model type (see <model> as a child element of <interface>).


  4. For guests that are to run in IBM® Secure Execution mode and cannot use the launchSecurity element in the virtual server configuration, ensure that the device uses the guest's bounce buffer, see Preparing the virtual server.

Example

  • To configure bonded interface bond0:
    <interface type="direct">
          <source dev="bond0" mode="bridge"/>
          <model type="virtio"/>
    </interface>   
    Figure 1. Direct interface type which configures a bonded interface
    This graphic shows the configuration of a MacVTap interface that connects to a bonded interface.
  • To configure virtual LAN bond0.623:
    <interface type="direct">
          <source dev="bond0.623" mode="bridge"/>
          <model type="virtio"/>
    </interface>   
    Figure 2. Direct interface type which configures a virtual LAN interface
    This graphic shows the configuration of a MacVTap interface that connects to a virtual LAN interface.