<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Darren,</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I tries this, but no success.  When I restart kea it complains that the class long-lease doesn't exist.  You defined short-lease as being known and not in long-lease, but how do you define long-lease?</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In the actual reservations, I tried both defining client-class of long-lease, and when the failed, I tried client-classes of long-lease, but kea still wants long-lease defined.</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The format of my configuration with reservations (in "pseudo-code")</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
subnet4--</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
      define subnet id 1</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
      define pool for subnet id 1</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
      include subnet id 1 reservations file - these reservations all define ip-address</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        define subnet id 2</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
      define pool for subnet id 2</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
      include subnet id 2 reservations file - these reservations all define ip-address</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
             ...</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Include global reservations file (reservations specifying hw-address, hostname, and some option-data for each host) - no ip</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The goal is: hosts that get an IP from any pool have a shorter lease time, and hosts that have an ip-address reserved for them get a much longer lease time</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jason.</div>
<div id="Signature"></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div class="elementToProof" style="direction: ltr; font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<b>From:</b> Kea-users <kea-users-bounces@lists.isc.org> on behalf of Darren Ankney <darren.ankney@gmail.com><br>
<b>Sent:</b> Friday, April 5, 2024 5:53 AM<br>
<b>To:</b> Kea user's list <kea-users@lists.isc.org><br>
<b>Subject:</b> Re: [Kea-users] different lease times</div>
<div class="elementToProof" style="direction: ltr;"> </div>
<div class="elementToProof" style="font-size: 11pt;">Hi Jason,<br>
<br>
Ahh yes.  I failed to remember the goal here.  All clients would be in<br>
that class.  I assume you have reservations for these static clients?<br>
You could, in these reservations add them to another class<br>
("long-lease").  Then you could alter the test line in short lease:<br>
<br>
"test": "member('KNOWN') and not member('long-lease')",<br>
<br>
I'm not entirely sure that will work.  It depends on where your<br>
reservations are set.  You may have to experiment with:<br>
"early-global-reservations-lookup"<br>
<br>
FYI, if you'd like to see a change to "valid-lifetime" (such as<br>
allowing use inside a pool), then you could add a comment indicating<br>
your support of: <a href="https://gitlab.isc.org/isc-projects/kea/-/issues/953" id="OWAebb47924-f9fb-410a-8fdb-439b0eb15152" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://gitlab.isc.org/isc-projects/kea/-/issues/953</a><br>
Be sure and describe, in detail, your use case for this change.<br>
<br>
Thank you,<br>
Darren Ankney<br>
<br>
On Thu, Apr 4, 2024 at 12:33 PM Jason Keltz <jas@yorku.ca> wrote:<br>
><br>
> Hi Darren,<br>
><br>
> I tried your suggestion, but unfortunately, it didn't quite work.<br>
> I modified my kea configuration as you specified.  My default<br>
> valid-lifetime is 4000.<br>
> In short-lease, I defined valid-lifetime to be 300 (exactly as yours is<br>
> specified).<br>
> In the pool used by my test host, I added the client-class for<br>
> short-lease as you specified.<br>
> I restarted kea dhcp server to ensure it re-read the configuration.<br>
> I checked for any existing lease from my test host "jastest", and there<br>
> was none.<br>
> I booted...<br>
> The lease was registered, and was for 300 seconds...<br>
><br>
> [ { "arguments": { "leases": [ { "client-id": "01:ac:24:11:5f:be:b7",<br>
> "cltt": 1712245568, "fqdn-fwd": false, "fqdn-rev": false, "hostname":<br>
> "jastest", "hw-address": "ac:24:11:5f:be:b7", "ip-address":<br>
> "130.63.XX.YY", "state": 0, "subnet-id": 6, "valid-lft": 300 } ] },<br>
> "result": 0, "text": "1 IPv4 lease(s) found." } ]<br>
><br>
> So good, so far, right?<br>
><br>
> I then assigned my test host an IP, cleared the DHCP lease for it, and<br>
> booted... the host got the proper IP outside of the pool, but it ALSO<br>
> had valid-lifetime 300 and not 4000!<br>
><br>
> Is this because:<br>
><br>
>         "client-classes": [<br>
>            {<br>
>              "name": "short-lease",<br>
>              "test": "member('KNOWN')",<br>
>              "valid-lifetime": 300<br>
>            }<br>
>          ],<br>
><br>
> ... automatically adds "short-lease" to any member of KNOWN?<br>
><br>
> I just wish that ISC made it so that valid-lifetime could be configured<br>
> in pool.<br>
><br>
> Jason.<br>
><br>
> On 4/4/24 05:34, Darren Ankney wrote:<br>
> > Hi Jason,<br>
> ><br>
> >   Something like this might work:<br>
> ><br>
> >         "client-classes": [<br>
> >            {<br>
> >              "name": "short-lease",<br>
> >              "test": "member('KNOWN')",<br>
> >              "valid-lifetime": 300<br>
> >            }<br>
> >          ],<br>
> > ...<br>
> >          "subnet4": [<br>
> >              {<br>
> >                  "subnet": "10.1.2.0/24",<br>
> >                  "id": 1,<br>
> >                  "option-data": [<br>
> >                      {<br>
> >                          "name": "routers",<br>
> >                          "data": "10.1.2.1"<br>
> >                      }<br>
> >                  ],<br>
> >                  "valid-lifetime": 300,<br>
> >                  "pools": [<br>
> >                      {<br>
> >                          "pool": "10.1.2.100-10.1.2.200",<br>
> >                          "client-class": [ "short-lease" ]<br>
> >                      }<br>
> >                  ]<br>
> >              }<br>
> >          ],<br>
> ><br>
> > On Wed, Apr 3, 2024 at 10:56 AM Jason Keltz <jas@yorku.ca> wrote:<br>
> >> Hi Darren,<br>
> >><br>
> >> Yes - "lease-lifetime" was my error - I meant "valid-lifetime".<br>
> >> I understand that I cannot apply "valid-lifetime" to a pool (although I<br>
> >> feel like I should be able to).<br>
> >> I already define client-class as "KNOWN" in all my pools so that unknown<br>
> >> hosts can't get an IP, and I understand that I can't use a second<br>
> >> client-class of "short-lease" in each pool.<br>
> >> I looked in the Kea code where options are defined, and thought I would<br>
> >> be able to add:<br>
> >><br>
> >>              {<br>
> >>                   "name": "dhcp-lease-time",<br>
> >>                   "data": "300"<br>
> >>               }<br>
> >><br>
> >> ... to "option-data" section for each host, but this didn't work<br>
> >> either.  I see that in the Kea docs, all-options.json skips from code 49<br>
> >> to code 52, thereby skipping over code 51 which is lease time.<br>
> >><br>
> >> I tried adding "code": 51, to the section to my option above, but it<br>
> >> didn't make any difference.<br>
> >><br>
> >> I tried adding "valid-lifetime" to the "reservations" section to see if<br>
> >> that would work, but it would not.<br>
> >><br>
> >> Therefore, I'm still not sure how to implement different lease times for<br>
> >> pools.<br>
> >><br>
> >> Jason.<br>
> >><br>
> >> On 4/3/24 06:35, Darren Ankney wrote:<br>
> >>> Hi Jason,<br>
> >>><br>
> >>><br>
> >>>> would it be valid syntax to also set lease-lifetime in the pool instead of using the class?<br>
> >>>><br>
> >>>>    "pools": [<br>
> >>>>                       {<br>
> >>>>                           "pool": "10.1.2.100-10.1.2.200",<br>
> >>>>                            "lease-lifetime": "300"<br>
> >>>>                       }<br>
> >>>> ]<br>
> >>> I cannot find evidence of a parameter called "lease-lifetime" but<br>
> >>> "valid-lifetime" cannot be set inside a pools [] block.<br>
> >>><br>
> >>>> I already assign the pools to "client-class": "KNOWN" - can I specify multiple classes? "client-class": "KNOWN", "short-lease"?<br>
> >>>> If I use a class to do this, is the "valid-lifetime": 300 inside the subnet definition necesary? It is repeated in both the subnet and the client-class short-lease.<br>
> >>> The "valid-lifetime" inside the subnet was a mistake.  That was a<br>
> >>> relic of some earlier testing.  You cannot specify multiple classes on<br>
> >>> a client-class line.  I don't know if you can have both client-class<br>
> >>> and client-classes as I've never tried.  "client-class" does not do<br>
> >>> the same thing that "client-classes" does.<br>
> >>><br>
> >>> Thank you,<br>
> >>> Darren Ankney<br>
> >> --<br>
> >> ISC funds the development of this software with paid support subscriptions. Contact us at
<a href="https://www.isc.org/contact/" id="OWA528027bb-b057-0494-4112-f16e0188f62d" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://www.isc.org/contact/</a> for more information.<br>
> >><br>
> >> To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" id="OWAf2bfe42c-9575-840a-caf4-c96a187269ac" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
> >><br>
> >> Kea-users mailing list<br>
> >> Kea-users@lists.isc.org<br>
> >> <a href="https://lists.isc.org/mailman/listinfo/kea-users" id="OWAd60a9d3e-5478-99fe-9cd1-63ecfa26b9b3" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://lists.isc.org/mailman/listinfo/kea-users</a><br>
><br>
><br>
> --<br>
> Jason Keltz<br>
> Computer Development Manager<br>
> Department of Electrical Engineering and Computer Science<br>
> York University<br>
> Toronto, Ontario Canada<br>
> Tel: (416) 736-2100 x. 33570<br>
> Fax: (416) 736-5872<br>
><br>
> --<br>
> ISC funds the development of this software with paid support subscriptions. Contact us at
<a href="https://www.isc.org/contact/" id="OWA2a923a8f-40cf-d889-95ae-f1a1173bc225" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://www.isc.org/contact/</a> for more information.<br>
><br>
> To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" id="OWAbf7467a6-f22a-976f-c1e8-9edaed0ebc45" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
><br>
> Kea-users mailing list<br>
> Kea-users@lists.isc.org<br>
> <a href="https://lists.isc.org/mailman/listinfo/kea-users" id="OWA7b3a0ada-5ae4-4579-2c38-2c06b96605d5" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://lists.isc.org/mailman/listinfo/kea-users</a><br>
--<br>
ISC funds the development of this software with paid support subscriptions. Contact us at
<a href="https://www.isc.org/contact/" id="OWAc2f727b3-15a7-a4db-b9f5-40441425cdb4" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://www.isc.org/contact/</a> for more information.<br>
<br>
To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users" id="OWA03530281-6e81-08e1-7066-8eb2dc2426e5" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
<br>
Kea-users mailing list<br>
Kea-users@lists.isc.org<br>
<a href="https://lists.isc.org/mailman/listinfo/kea-users" id="OWA84d9e3f1-01ff-5483-0057-83dad87894c5" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">https://lists.isc.org/mailman/listinfo/kea-users</a></div>
</body>
</html>