[Dnsmasq-discuss] DHCP - multiple ranges on the same interface

Simon Kelley simon@thekelleys.org.uk
Fri, 07 Jan 2005 16:53:03 +0000


Mark Wiater wrote:

> Again, I was trying to avoid having a unique dnsmasq.conf for each
> endpoint. Allocating an address from a block associated with a netid
> would be ideal.
> 
>

The code to implement this would be pretty trivial: the difficult bit is 
doing it without making the configuration impossibly baroque.

Essentially at the moment, dnsmasq generates a list of netid tags from 
the dhcp-range in use and any matching vendorclasses and userclasses and 
any matching dhcp-host. It then uses that list to filter any dhcp-option 
and dhcp-boot lines.

Multiple dhcp-ranges on the same network are already implemented, 
currently addresses are taken from any range on the network.

All that is needed is an additional netid-tag associated with a 
dhcp-range which is used to exclude non-matching ranges. (And a man page 
which explains it all sensibly!)

Note to anyone thinking about implementing a DHCP server: think hard 
about configuration before you start. I seriously underestimated the 
flexibility of configuration which would be needed. Since I've kept 
backwards compatibility to the first, simplistic, versions, easy things 
are easy, but hard things are now needlessly hard.

Cheers,

Simon.