[Dnsmasq-discuss] DHCP leases in multiple VLANs

Ferenc Wagner wferi at niif.hu
Wed Sep 1 11:35:49 BST 2010


Simon Kelley <simon at thekelleys.org.uk> writes:

> Ferenc Wagner wrote:
> 
>> I came to realise that dnsmasq can't register multiple addresses of a
>> single client obtained in different VLANs, because they belong to the
>> same MAC address, so knock each other out of the lease file.
>> 
>> I suggest the lease file contain the interface as well (and the
>> interface also passed to the dhcp-script) to overcome this limitation.
>> 
>> Would this be acceptable?
>
> The interface isn't a good thing to keep the leases unique: it doesn't
> deal with requests that go via  DHCP-relay agents, for one thing.

Indeed.  But those requests have a much better chance of coming from
different MAC addresses.

> A good workaround would be to set the client-id differently for each
> VLAN.

Absolutely.  Unfortunately, neither the network boot ROM nor ipconfig
(the klibc utility used widely for network configuration in the
initramfs of nfsrooted hosts) supports changing the client-id.  So this
scenario is rather hopeless.  Fortunately, in such cases the lease
obtained by the PXE boot ROM is usually not needed by the time the new
lease (in another VLAN) is acquired, but we lose the stability of IP
addresses because of this flip-flop.

> DHCP clients should maybe do this anyway: it's dodgy to have the same
> MAC address in more than one broadcast domain at the same time.

Could you please explain why that is dodgy?

> It may be possible to relax dnsmasq a bit: really only the IP address
> needs to be unique in the lease database, but I'm not quite sure there
> wouldn't be obscure consequences.

Maybe if several subnets are used in one VLAN...  But as far as I can
see, ISC DHCPD does something like this (the lease file is keyed by IP
address only) and it seems to fare quite well.  Please consider enabling
this in dnsmasq, too (although its lack isn't a show-stopper for me
right now).
-- 
Thanks,
Feri.



More information about the Dnsmasq-discuss mailing list