KVM Libvirt Bridged - KVM Libvirt Bridged - UG1739

AMD Solarflare X4 Series Ethernet Adapter User Guide (UG1739)

Document ID
UG1739
Release Date
2026-08-04
Revision
1.4 English

This configuration uses the standard Linux bridge in the host to interface to the PF. The bridge emulates a layer 2 learning switch to replicate multicast and broadcast packets in software and supports the transport of network traffic between VMs and the physical port.

This configuration uses standard Linux tools for configuration and needs only a virtualized environment and guest operating system.

Performance (latency/throughput) is lower than a network-hostdev configuration because network traffic must pass via the host kernel.

Figure 1. KVM Libvirt Bridged

Configuring KVM Libvirt Bridged

To configure a KVM Libvirt Bridged setup:

  1. Ensure the AMD Solarflare adapter driver (sfc.ko) is installed on the host.
  2. Create virtual machines.

    You can create VMs from the standard Linux virt-manager GUI interface, or from the equivalent virsh command line tool.

    Note: To start the GUI interface, run the virt-manager command as root from a terminal .

    You can also create VMs from an existing VM XML file.

    The following example procedure assumes the VM is created. It creates a bridge ‘br1’ and a network ‘host-network’ to connect the VM to the X4 series adapter via the bridge.

  3. Define a bridge in /etc/sysconfig/network-scripts/ifcfg-br1:
    DEVICE=br1
    TYPE=Bridge
    BOOTPROTO=none
    ONBOOT=yes
    DELAY=0
    NM_CONTROLLED=no
  4. Associate the bridge with the required X4 series PF (HWADDDR) in a config file in /etc/sysconfig/network-scripts/ifcfg-eth4. This example uses eth4:
  5. Bring up the bridge:
    # service network restart
  6. Confirm the bridge is visible in the host using the ifconfig command:
    # ifconfig -a
    br1       Link encap:Ethernet HWaddr 74:27:2C:21:00:60
              inet6 addr: fe80::20f:53ff:fe21:60/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
              RX packets:170 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:55760 (54.4 KiB) TX bytes:468 (468.0 b)
  7. Define a network in an XML file. This example uses host-network.xml:
    <network>
      <name>host-network</name>
      <forward mode='bridge'/>
      <bridge name="br1"/>
    </network>
  8. Define and start the network using virsh net-<option> commands:
    # virsh net-define host-network.xml
    Network host-network defined from host-network.xml
    # virsh net-start host-network
    Network host-network started
    # virsh net-autostart host-network
    Network host-network marked as autostarted
    # virsh net-list --all
    Name                 State      Autostart   Persistent
    ------------------------------------------------------
    default              active     yes         yes
    host-network         active     yes         yes
  9. On the host machine, edit the VM XML file:
    # virsh edit <vmname>
  10. Add the network component to the VM XML file:
    <interface type='network'>
      <source network='host-network'/>
      <model type='virtio'/>
    </interface>
  11. Restart the VM after editing the XML file.
    # virsh start <vmname>
  12. The bridged interface is visible in the VM when viewed from the GUI Virtual Machine Manager:
    Figure 2. Virtual Machine Manager , Showing the Network/Bridged Interface

XML Description for KVM Libvirt Bridged

The following extract is from the VM XML file after the configuration procedure has been applied. Line numbers have been added for ease of description:

   1. <interface type='bridge'>
   2.  <mac address='52:54:00:96:0a:8a'/>
   3.  <source bridge='br1'/>
   4.  <model type='virtio'/>
   5.  <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
   6. </interface>
  1. The interface type. This must be specified as ‘bridge’.
  2. The MAC address. If this is not specified a random MAC address is assigned automatically by libvirt.
  3. The source bridge. This is as created in configuration step 3 above.
  4. The model type. This must be specified as ‘virtio’.
  5. The PF PCIe address (as known by the guest). This is added automatically by libvirt.

For further information about the libvirt bridged configuration and XML formats, refer to the following link:

http://libvirt.org/formatdomain.html#elementsNICSBridge