O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To create a new bridge interface using libvirt, run the following commands:

  1. Create a new bridge interface configuration file:
root@kvm:~# cat test_bridge.xml<interface type='bridge' name='test_bridge'> <start mode="onboot"/>   <protocol family='ipv4'> <ip address='192.168.1.100' prefix='24'/> </protocol> <bridge>   <interface type='ethernet' name='vnet0'>     <mac address='fe:54:00:55:9b:d6'/>   </interface> </bridge></interface>root@kvm:~#
  1. Define the new interface:
root@kvm:~# virsh iface-define test_bridge.xmlInterface test_bridge defined from test_bridge.xmlroot@kvm:~#





 

 

  1. List all interfaces libvirt knows about:
root@kvm:~# virsh iface-list --all Name            State       MAC Address--------------------------------------------------- ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required