[Dnsmasq-discuss] DHCP - multiple ranges on the same interface
Simon Kelley
simon@thekelleys.org.uk
Fri, 07 Jan 2005 14:02:30 +0000
Mark Wiater wrote:
> Hello,
>
> I'm hoping you can help guide me in the right direction with this.
>
> I've got a situation where i need to use the dhcp-vendorclass option...
>
> 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.
If your "special" hosts have known MAC addresses, you could just
allocate them addresses inside the 'test' block using "dhcp-host"
configuration lines.
>
> 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.
> 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?
>
> 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?
Cheers,
Simon.