[Kea-users] Host reservations, bootfilename and client classes

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Kea-users] Host reservations, bootfilename and client classes

mkangelo
This post was updated on .
Hi guys,

We are evaluating KEA (premium) as a potential replacement for our current
DHCP infra, and we have few concerns over the following:

1. Is it possible to have a custom bootFilename (option 67) set per host
reservation while it references to a single client class? (this should not
be part of the subnets).

2. Is it possible to prioritise bootFilename from a class (even if there is
already a bootFilename set in the reservation) based on the matching client
option (example 60, 77) ?

To clarify:

- We need clients that have option 77 to receive bootFilename from a
reservation and in case it doesn't have option 77 and matches just option 60
to receive bootFilename from that class.

- There will be multiple classes configured, and we'd like the host
reservations to be stored in a SQL database


I'd appreciate some feedback.


Example JSON config (classes and reservation - used for testing):


"client-classes":
    [
      {
        "name": "legacy_BIOS",
        "test": "substring(option[77].hex,0,4) == 'gPXE'",
       //  "boot-file-name": {{ THIS FILENAME SHOULD BE STORED IN THE HOST RESERVATION }}
      },
      {
        "name": "Legacy",
        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00000'",
        "boot-file-name": "undionly.kpxe"
        "next-server" : "192.0.2.254"
      }
      {
        "name": "UEFI-64-1",
        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00007'",
        "boot-file-name": "ipxe/x86_64/ipxe.efi"
      },
]
               "reservations": [
                    {
                        "hw-address": "00:50:56:9b:b7:e2",
                        "ip-address": "172.16.79.20",
                        "hostname": "netboot.example.com",
                        "next-server": "172.16.79.1",
                        "boot-file-name": "undionly.kpxe",
                        "option-data": [
                            {
                                "name": "routers",
                                "data": "172.16.79.1",
                                "always-send": true
                            },
                            {
                                "name": "tftp-server-name",
                                "data": "172.16.79.1",
                                "always-send": true
                            },
                            {
                                "name": "boot-file-name",
                                "data": "undionly.kpxe",
                                "always-send": true
                            }
                        ]
]

--
Sent from: http://kea-users.7364.n8.nabble.com/
_______________________________________________
Kea-users mailing list
Kea-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Host reservations, bootfilename and client classes

Marcin Siodelski
Hello,

Your example JSON config didn't seem to make it through the email.

See my comments/questions inline.

On 30/04/2019 16:46, mkangelo wrote:
> Hi guys,
>
> We are evaluating KEA (premium) as a potential replacement for our current
> DHCP infra, and we have few concerns over the following:
>
> 1. Is it possible to have a custom bootFilename (option 67) set per host
> reservation while it references to a single client class? (this should not
> be part of the subnets).
>

So, there is a subset of clients having host reservations, each client
having one of the classes assigned and each class coming with a
different option 67 value? Or it is that each client has its own option
67 value defined as the host reservation within the database?

> 2. Is it possible to prioritise bootFilename from a class (even if there is
> already a bootFilename set in the reservation) based on the matching client
> option (example 60, 77) ?
>

It depends on the answer to the first question. Generally, options can
be freely ordered between classes. If the host reservation is made for a
class (not an option) and than for this class there is an option 67
value specified in the config file you can build the classes'
dependencies such that one or the other takes precedence. If you're
thinking to specify option 67 in the database (with host reservations),
then it becomes tricky because Kea has no knob to say that client class
specific option takes precedence over the option from the host reservation.

To expand on this, it would be useful to work on a specific example.

> To clarify:
>
> - We need clients that have option 77 to receive bootFilename from a
> reservation and in case it doesn't have option 77 and matches just option 60
> to receive bootFilename from that class.
>
> - There will be multiple classes configured, and we'd like the host
> reservations to be stored in a SQL database
>

What do you mean by reservations? You mean values of the option 67 for
each host?

>
> I'd appreciate some feedback.
>
>
> Example JSON config (classes and reservation - used for testing):
>
>
>
>
>
> --
> Sent from: http://kea-users.7364.n8.nabble.com/
> _______________________________________________
> Kea-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/kea-users
>

Marcin Siodelski
DHCP Software Engineer,
ISC
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Host reservations, bootfilename and client classes

brna62petsto
Hello Marcin,

Thanks for your reply. What mkangelo and I are trying to do is to replace
Microsoft DHCP server which has a feature to create host reservations with
two option 67 values which are served to the client based on the class
(type) of the client - for example return undionly.kpxe when client is pxe
return https://api.example.com/customurl/ when client is gpxe

Client class is extracted from DHCP Discover packets:
IF Option [77] == gPXE then second value is being returned
ELSEIF Option [60] == "PXEClient:Arch:00000:UNDI:002001" then first value is
returned

Let me know if you have any suggestions how to create this logic in Kea.

Regards,
Branimir



--
Sent from: http://kea-users.7364.n8.nabble.com/
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Host reservations, bootfilename and client classes

Marcin Siodelski
Hello Branimir,

Please see inline.

On 07/05/2019 16:14, brna62petsto wrote:
> Hello Marcin,
>
> Thanks for your reply. What mkangelo and I are trying to do is to replace
> Microsoft DHCP server which has a feature to create host reservations with
> two option 67 values which are served to the client based on the class
> (type) of the client - for example return undionly.kpxe when client is pxe
> return https://api.example.com/customurl/ when client is gpxe
>

If they are just two different values for option 67, why do they have to
be stored in the database? Can they be specified in the config file
within the classes definition?

> Client class is extracted from DHCP Discover packets:
> IF Option [77] == gPXE then second value is being returned
> ELSEIF Option [60] == "PXEClient:Arch:00000:UNDI:002001" then first value is
> returned
>
> Let me know if you have any suggestions how to create this logic in Kea.
>
> Regards,
> Branimir
>
>
>
> --
> Sent from: http://kea-users.7364.n8.nabble.com/
> _______________________________________________
> Kea-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/kea-users
>


Marcin
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Host reservations, bootfilename and client classes

Jorell F
In reply to this post by mkangelo

Didn’t send to list.

 


From: Jorell F
Sent: Wednesday, May 8, 2019 10:37:04 AM
To: mkangelo
Subject: RE: [Kea-users] Host reservations, bootfilename and client classes
 

Is this the answer you are looking for:

 

    "next-server": "<serverip>",

    "option-data":

    [

      {

        "name":  "no-pxedhcp",

        "data":  "1",

        "code":  176,

        "space": "ipxe"

      },

      {

        "name": "tftp-server-name",

        "data": "<serverip>"

      }

    ],

    "client-classes":

    [

      {

        "name": "Legacy ",

        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00000'",

        "boot-file-name": "ipxe/undionly.kpxe"

      },

      {

        "name": "UEFI-32-1",

        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00002'",

        "boot-file-name": "ipxe/i386/ipxe.efi"

      },

      {

        "name": "UEFI-32-2",

        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00006'",

        "boot-file-name": "ipxe/i386/ipxe.efi"

      },

      {

        "name": "UEFI-64-1",

        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00007'",

        "boot-file-name": "ipxe/x86_64/snponly.efi"

      },

      {

        "name": "UEFI-64-2",

        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00008'",

        "boot-file-name": "ipxe/x86_64/snponly.efi"

      },

      {

        "name": "UEFI-64-3",

        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00009'",

        "boot-file-name": "ipxe/x86_64/snponly.efi"

      },

      {

        "name": "EFI_HTTP",

        "test": "option[93].hex == 0x0010",

        "option-data": [ { "name": "vendor-class-identifier", "data": "HTTPClient" } ],

        "boot-file-name": "http://<serverip>:80/ipxe/x86_64/snponly.efi"

      },

      {

        "name": "XClient_iPXE",

        "test": "substring(option[77].hex,0,4) == 'iPXE'",

        "boot-file-name": "http://<serverip>:80/ipxe/boot.php"

      }

    ],

 

Clients that are PXE booting get the boot file, clients that already have the boot file get the config file.

(this config was working on kea v1.4)

I believe kea uses a last to match, if an option does not exist deeper in the config i.e. reservations, it will pull from subnet or global.

 

 


From: Kea-users <[hidden email]> on behalf of mkangelo <[hidden email]>
Sent: Tuesday, April 30, 2019 7:46:13 AM
To: [hidden email]
Subject: [Kea-users] Host reservations, bootfilename and client classes
 
Hi guys,

We are evaluating KEA (premium) as a potential replacement for our current
DHCP infra, and we have few concerns over the following:

1. Is it possible to have a custom bootFilename (option 67) set per host
reservation while it references to a single client class? (this should not
be part of the subnets).

2. Is it possible to prioritise bootFilename from a class (even if there is
already a bootFilename set in the reservation) based on the matching client
option (example 60, 77) ?

To clarify:

- We need clients that have option 77 to receive bootFilename from a
reservation and in case it doesn't have option 77 and matches just option 60
to receive bootFilename from that class.

- There will be multiple classes configured, and we'd like the host
reservations to be stored in a SQL database


I'd appreciate some feedback.


Example JSON config (classes and reservation - used for testing):





--
Sent from: http://kea-users.7364.n8.nabble.com/
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users

_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Host reservations, bootfilename and client classes

brna62petsto
In reply to this post by Marcin Siodelski
Hello Marcin,

Both options 67 have to be related to a single reservation. We need to be
able to have different values for options 67 returned to the same server,
depending on values it has in DHCP discover option60 / option77.

Branimir



--
Sent from: http://kea-users.7364.n8.nabble.com/
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Host reservations, bootfilename and client classes

brna62petsto
In reply to this post by Jorell F
Hello Jorell,

Thanks, but that's not what we are looking for. It is crucial for us to have
user-class filtering per reservation..



--
Sent from: http://kea-users.7364.n8.nabble.com/
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users