https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/sect-Virtualization_Host_Configuration_and_Guest_Installation_Guide-Network_Configuration-Network_Configuration-Bridged_networking_with_libvirt.html
Bridged networking (also known as physical device sharing) is used to dedicate a physical device to a virtual machine. Bridging is often used for more advanced setups and on servers with multiple network interfaces.
To create a bridge (
br0
) based on the
eth0
interface, execute the following command on the host:
# virsh iface-bridge eth0 br0
Important
NetworkManager does not support bridging. NetworkManager must be disabled to use networking with the network scripts (located in the
/etc/sysconfig/network-scripts/
directory).
# chkconfig NetworkManager off # chkconfig network on # service NetworkManager stop # service network start
If you do not want to disable
NetworkManager entirely, add "
NM_CONTROLLED=no
" to the
ifcfg-*
network script being used for the bridge.
if there is error:
libvirtError: this function is not supported by the connection driver: virInterfaceDefineXML
That's because you've libvirt compiled with udev rather than netcf. The
netcf is the only one backend that knows how to create a new interface.
Install netcf and rebuild libvirt and you should be able to create
interfaces via libvirt.
https://www.redhat.com/archives/libvirt-users/2014-March/msg00091.html