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.
Configuring KVM Libvirt Bridged
To configure a KVM Libvirt Bridged setup:
- Ensure the AMD Solarflare adapter driver (sfc.ko) is installed on the host.
- Create virtual machines.
You can create VMs from the standard Linux
virt-managerGUI interface, or from the equivalentvirshcommand line tool.Note: To start the GUI interface, run thevirt-managercommand 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.
- Define a bridge in /etc/sysconfig/network-scripts/ifcfg-br1:
DEVICE=br1 TYPE=Bridge BOOTPROTO=none ONBOOT=yes DELAY=0 NM_CONTROLLED=no - 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: - Bring up the bridge:
# service network restart - Confirm the bridge is visible in the host using the
ifconfigcommand:# 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) - 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> - 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 - On the host machine, edit the VM XML file:
# virsh edit <vmname> - Add the network component to the VM XML file:
<interface type='network'> <source network='host-network'/> <model type='virtio'/> </interface> - Restart the VM after editing the XML file.
# virsh start <vmname> - 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>
- The interface type. This must be specified as ‘bridge’.
- The MAC address. If this is not specified a random MAC address is assigned automatically by libvirt.
- The source bridge. This is as created in configuration step 3 above.
- The model type. This must be specified as ‘virtio’.
- 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: