[libvirt] Making DHCP leases available to local DNS server through dnsmasq

jean-christophe manciot actionmystique at gmail.com
Sat Jun 10 18:53:16 UTC 2017

Hello everyone,

I have multiple virtual networks defined on my Server:
# virsh net-list --all
 Name                 State      Autostart     Persistent
 default              active     yes           yes
 virtual-mgt-5        active     yes           yes

When a VM is started on one of them with an interface which needs the
dnsmasq DHCP server to get its IP address/len, it remains inaccessible with
the FQDN once the IP information is acquired.

The default values are used for each dnsmasq instance:
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor
preset: enabled)
   Active: active (running) since Sat 2017-06-10 19:48:58 CEST; 3ms ago
     Docs: man:libvirtd(8)
 Main PID: 25365 (libvirtd)
    Tasks: 35 (limit: 4915)
   Memory: 27.1M
      CPU: 28ms
   CGroup: /system.slice/libvirtd.service
           ├─22262 /usr/sbin/dnsmasq
--conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro
           ├─22263 /usr/sbin/dnsmasq
--conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro
           ├─24061 /usr/sbin/dnsmasq
--conf-file=/var/lib/libvirt/dnsmasq/virtual-mgt-5.conf --leasefile-ro
           ├─24062 /usr/sbin/dnsmasq
--conf-file=/var/lib/libvirt/dnsmasq/virtual-mgt-5.conf --leasefile-ro
           ├─25365 /usr/sbin/libvirtd
           └─25384 /usr/sbin/dnsmasq --help

I wonder whether the option "--leasefile-ro" gets in the way or not: there
must be a key=value in /etc/libvirt/qemu/networks/<virtual_network>.xml to
enable this behavior, but could not find it in the Network XML format

The contents of my XML file are:
<network ipv6='yes'>
  <forward mode='route'/>
  <bridge name='virbr5' stp='on' delay='0'/>
  <mac address='52:54:00:b9:ea:63'/>
  <domain name='actionmystique.net'/>
  <ip address='' netmask=''>
      <range start='' end=''/>
  <ip family='ipv6' address='fc21::1' prefix='64'>
      <range start='fc21::1' end='fc21::fffe'/>

Any suggestion?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170610/ce28f240/attachment-0001.htm>

More information about the libvir-list mailing list