Leases based on MAC addresses

Elliot Finley lists at efinley.com
Mon Feb 9 04:13:41 UTC 2009


Simon Hobson wrote:
> sthaug at nethelp.no wrote:
> 
>> For me this is situation is not quite the same as a static lease. Aside
>> from possibly breaking the standard, I think it's perfectly reasonable
>> to want a DHCP server with the following characteristics:
>>
>> - Leases should *always* be based on MAC address, not UID. If the same
>> MAC address asks again, it should always receive the same answer. One
>> implication of this is only one IP address per MAC address. Another is
>> that as soon as a MAC address has been "seen" by the DHCP server, the
>> IP address handed out by the server must be remembered "forever" (or
>> at least until manually removed).
>> - The actual value of the IP address itself is uninteresting (server
>> can pick) - this makes it different from a static lease.
> 
> Then you are another voice asking for a feature that got on the roadmap 
> but I believe dropped (or at least put to one side). There was talk of 
> having a config option to change the primary key. At the moment, it is 
> hardcoded to be "pick first value(client id, hardware)", what you want 
> is to change it to just "hardware".
> 
> There were some patches, but that was some time ago and I don't know if 
> they were ever kept up with current versions. These were to solve a 
> different but related problem of multi-boot machines where one OS sends 
> the hardware MAC address as the client id, while others send nothing.
> 
> I believe the patch did something like "if the client id is empty, then 
> set it to the value of hardware". A simpler patch for you might be to 
> simply blank out the client id in any received packet.

I've spent some time looking through the sources.  The one thing I've 
figured out is - it's been a LONG time since I've programmed in C.  If 
you would be so kind as to point out which file/function I need to blank 
out the client id in, I would be ever grateful.

Thanks,
Elliot



More information about the dhcp-users mailing list