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

Mark Wiater mwiater@cablespeed.com
Fri, 07 Jan 2005 09:23:44 -0500


On Fri, 2005-01-07 at 14:02 +0000, Simon Kelley wrote:

> > I want to reserve a small block of addresses for those hosts who present
> > a specific vendor id, all others get an address out of the pool without
> > an associated network id.
> 
> That's not directly possible: It's possible to use vendorclass to 
> control which set of options a host receives, but not the address it 
> gets allocated.

Oh no, that's sad.
> 
> If your "special" hosts have known MAC addresses, you could just 
> allocate them addresses inside the 'test'  block using "dhcp-host" 
> configuration lines.

That was my original solution but I was hoping to avoid having to
customize each dhcp server to a client. I'm evaluating dnsmasq as part
of a corporate vpn deployment and wanted to have a single dnsmasq
configuration for all of the remote nodes. 
> 
> 
> > 
> > This is the relevant configuration:
> > 
> > dhcp-range=test,172.16.1.4,172.16.1.15,1h
> > 
> > dhcp-range=172.16.1.32,172.16.1.199,12h
> > dhcp-vendorclass=test,vendor.class.identifier
> > dhcp-option=test,176,opt1=10.0.0.50,opt2=1719,opt3=10.0.0.49
> ^^^^^^^^^^  this looks very strange, you need a separate "dhcp-option" 
> line for each option.

it works fine like that.
> 
> > dhcp-option=7,172.16.1.1
> > 
> > 
> > What I'm finding is that a host who doesn't present a vendor class
> > identifier at all is getting an address in the TEST network id range.
> > 
> > For what it's worth, I've also found that I need to have the whole
> > string 'vendor.class.identifier' configured, else dnsmasq will not
> > assign an IP in the reserved space.
> 
> 
> It should do a substring match: do you still see that with verions 2.19?

I'll test that as soon as I can.
> > 
> > One more data point, the host that is getting the address in the
> > reserved space is setting option 50 with ip address 172.16.1.13, is it
> > possible to tell dnsmasq to ignore hosts that request a specific
> > address?
> 
> You can tell dnsmasq to ignore clients with a specific MAC address.
> You can also tell dnsmasq to allocate a particular address to a 
> particular host and it will then reject attempts by that host to use a 
> different address. Is that what you need?

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.

> 
> 
> Cheers,
> 
> Simon.
> 
BTW, good work on dnsmasq. And thanks.

Mark