[Dnsmasq-discuss] DHCP Address - Lease in numerical order
simon at thekelleys.org.uk
Thu Dec 20 21:12:47 GMT 2007
Eric Arnoldy wrote:
> Hey All,
> I've looked everywhere and can't seem to find mention of it, but does
> dnsmasq support DHCP addresses being handed out in numerical order?
> I want the first box connected to get .100, then 101 for the next one
> and so forth. I see there is some logic in there to check and see if
> its already been taken, but from what I see here, the addresses that I
> get appear to be random.
It's not random: the address is derived from the start and end addresses
of the address pool and a hash of the MAC address. This means that a
given host will (nearly) always be offered the same address, without
dnsmasq having to keep track of the addresses allocated in the past to
hosts which don't have a lease right now.
The alternatives are it to keep a much bigger database which has
historical information about all leases offered to all hosts for all
time (ISC), or not to attempt to give hosts stable addresses at all
(udhcpd). I thought the hash-function trick was a particularly neat
> I am specifying a start and end for the pool using the dhcp-range, but
> I guess thats just possible addresses, not where it will acutally
> start giving out addresses.
> Anyhelp, or assistance in this matter would be much apprecieated.
If you really want to, you can patch the code, but I'm not convinced
that the gains outweigh the losses.
> Thank you!
> Eric Arnoldy
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
More information about the Dnsmasq-discuss