0

I am trying to use libvirt + dsnmasq + openvswitch to create a bridged network with dhcp enabled. I created a libvirt network with the following XML:

<network connections='1'>
  <name>ovs-net</name>
  <uuid>fffd6fea-a753-4fca-b684-76fb24866ba3</uuid>
  <forward mode='bridge'/>
  <bridge name='ovsbr0'/>
  <vlan>
    <tag id='1298'/>
  </vlan>
  <virtualport type='openvswitch'/>
</network>

I can create guests using this network, e.g.:

<domain>
...
    <interface type='network'>
        <mac address='52:54:00:a6:3b:48'/>
        <source network='ovs-net'/>
        <model type='virtio'/>
        <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
    </interface>
</domain>

I can manually configure an IP address on the guest and send inbound/outbound traffic. When I edit the ovs-net xml to include an IP address and DHCP configuration it fails as follows:

virsh net-edit --network ovs-net 

<network connections='1'>
<name>ovs-net</name>
...
<ip address='10.20.101.121' netmask='255.255.255.0'>
    <dhcp>
      <range start='10.20.101.121' end='10.20.101.130'/>
      <host mac='52:54:00:7a:6d:e7' name='test.com' ip='10.20.101.120'/>
    </dhcp>
  </ip>
</network>

error: unsupported configuration: Unsupported <ip> element in network ovs-net with forward mode='bridge'

My networking knowledge is limited, so I am not sure if what I am trying to do is possible.

1

The schema essentially supports two classes of setup. The managed setup is based on a traditional bridge device that libvirt creates itself, and runs dnsmasq for DNS/DHCP service. The unmanaged setup is based on a traditional bridge, or openvswitch or macvtap or several other options. In the latter case, libvirt doesn't actually create anything itself - it is just a way to associate libvirt with the externally created network infra. As such libvirt won't run dnsmasq for these either, hence why it is rejecting your request to setup IP addrs / dhcp ranges.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.