KVM bridge interface

Page content

How to bridge KVM VMs onto physical network

The default bridge on KVM is 192.168.122.1/24.

We’re going to create a bridge to allow VMs to have an IP on your physical network.

  1. Create a bridge br0

    nmcli con add ifname br0 type bridge con-name br0
    
  2. Now we’re going to enslave br0 to the interface with an appearance on the network you want to glom onto. In my case it’s enp7s0f0:

    nmcli con add type bridge-slave ifname enp7s0f0 master br0
    
  3. Trust but verify

    nmcli connection show
    
  4. Flop any IP you had on the old MAC to the new generated br0 MAC.

  5. Make a file called br0.xml somewhere (anywhere) that has this in it:

    <network>
    <name>br0</name>
    <forward mode="bridge"/>
    <bridge name="br0" />
    </network>
    
  6. Run these virsh commands to define the network:

    virsh net-define /tmp/br0.xml
    virsh net-start br0
    virsh net-autostart br0
    virsh net-list --all