Exponential Lease Time

Norman Elton normelton at gmail.com
Fri Aug 31 17:46:21 UTC 2012


You can set variables that are written to the leases file using the
"set" command of an 'on commit" block. Since the variables are
preserved across requests, you can actually count the number of
renewals:

on commit {
	if index = 1 {
		log(info, "First renewal!");
		set index = 2;

	} elsif index = 2 {
		log(info, "Second renewal!");
		set index = 3;

	} elsif index = 3 {
		log(info, "Third renewal");

	} else {
		log(info, "Initial request");
		set index = 1;
	}
}

The problem is, I can't figure out how to adjust the lease time per
renewal. It seems that once the "on commit" has started, the lease
time is already determined. I can change other options. In fact,
setting the routers works like a champ, if that's what you wanted to
do!

Working from another front, I can set the lease time using a client
class, but I can't seem to write a "match" clause that references the
variable defined in my script.

Any idea how to tweak the lease time in a script? Or how to use a
variable in a class match clause?

Norman

On Fri, Aug 31, 2012 at 8:31 AM, John Hascall <john at iastate.edu> wrote:
>
>
> This seems like it might not be a too difficult mod.
> If there is a "multiply-lease-time" statement that is
> in scope and has a value > 1 then ignore the client's
> requested lease time and compute:
>
>   if (!active-lease) {
>       lease-time = min-lease-time;
>   } else {
>       lease-time = min(max-lease-time,
>                    max(min-lease-time,
>                        active-lease-time * multiply-lease-time));
>   }
>
> Does this seem correct?
>
>
> John
>
>
>
>> I think this could be nothing more than a pool statement that would set the g
> rowth rate. The min and max could be set using the min-lease-time and max-lease
> -time statements.
>> _________________________________________________________
>> Nicholas Miller, OIT, University of Colorado at Boulder
>
>> On Aug 29, 2012, at 2:08 PM, John Hascall wrote:
>> > Ideally you could specify the starting point, the growth
>> > rate (not just fixed at 2x) and the upper bound.
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users


More information about the dhcp-users mailing list