logging the lease time *sent* to clients in an "on commit" block

Phil Mayers p.mayers at imperial.ac.uk
Mon May 21 13:44:17 UTC 2007


>>
>> Does anyone know if it's possible or not?
> 
> I haven't actually tested it, but option dhcp-lease-time looks like the
> right thing. You may also need to check option dhcp-message-type to
> make sure you are recording it for the right type of packet as this can

Apologies if I was unclear: I'm aware it's the right option. What I'm 
having trouble is logging the value of the option from the ACK, as 
opposed to the value of the option from the REQUEST (which is often 
unset anyway).

As I mentioned, logging "option dhcp-lease-time" logs the one from the 
REQUEST. Logging "config-option dhcp-lease-time" logs nothing, 
presumably because there is no configured option for that as such; 
merely the "default-lease-time" and "max-lease-time"

In theory something like:

set lease-time-reply = min(
   pick-first-value(option dhcp-lease-time, default-lease-time),
   max-lease-time
);

....would give you the same value that the DHCP server would requests, 
but it's not clear to me how you get the "default-lease-time" and 
"max-lease-time" for the *lease under consideration* as opposed to the 
value of those in the enclosing scope. And in any event there's no "max" 
function or a > numeric operator.


More information about the dhcp-users mailing list