[Libvir] [Discussion] 0/4 Implement DHCP host mappings for virtual networks

Richard W.M. Jones rjones at redhat.com
Thu Feb 21 20:54:06 UTC 2008


This is a series of patches to implement DHCP IP & hostname mappings
for libvirt virtual networks.

 ** NOTE: This patch is not to be applied.  There is some memory
    corruption bug which I'm still tracking down.

What this patch allows you to do is to create a table of IP address to
host (defined by its hardware / MAC address) for each virtual network.
Optionally you can also assign a hostname.  When a host starts up and
requests an IP address through DHCP, if it is in this table then it
gets the fixed IP address from the table and, optionally, a fixed
hostname.

Four new API calls are added.  Two are required to list the contents
of the mapping table.  Two more allow you to add and delete a mapping.

The mapping table is semi-permanent.  It is stored in
/var/lib/libvirt/hosts-<networkname>.conf and survives across libvirtd
restarts.

The implementation simply uses dnsmasq's --dhcp-hostsfile flag.  Refer
to the dnsmasq(1) manual page.

Rich.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903




More information about the libvir-list mailing list