Perhaps the question was poorly framed, and/or a poor example was provided.
I’ll reframe the question and provide an example from my PoC.
Assume I have a many relays, and behind each of those relays are multiple
clients that present one of many different option 60 values.
What methods can I use to advertise the correct boot-file-name to the correct
vendor class? In ISC DHCPD, I did this by creating a class, matching options
and setting the filename. i.e.:
shared-network RGW02_LAB-RESI_MANAGEMENT {
class "RGW02_LAB_ZNID-GE-2628A" {
match if (substring(option vendor-class-identifier, 0, 13) =
"ZNID-GE-2628A") and
substring(option agent.remote-id,2,9) = "rgw02.lab";
filename "26xx_current/S0300608";
}
I’d like to assume that in Kea I can create a client-class and reference that
class within each subnet, but my attempt (below) throws errors on reload, so
I’m not sure how to implement it. Some sort of “if” matching somewhere? Do I
need to be more granular with the creation of the client-classes (i.e.: test
for the agent id AND the vendor class and then set boot file)? The thought of
the creation of many, many, extremely granular client-classes that match agent
id and vendor class was what stemmed the original question about templates.
{
"Dhcp4": {
"client-classes": [
{
"name": "rgw01.lab",
"test": "substring(relay4[2].hex,2,9) == 'rgw01.lab'"
},
{
"name": "rgw02.lab",
"test": "substring(relay4[2].hex,2,9) == 'rgw02.lab'"
},
{
"name": "VENDOR_CLASS_ZNID-GE-2628A-00-0GN",
"boot-file-name": “file1"
},
{
"name": "ZNID-GE-2628A-00-0GN",
"test" : "option[60].hex == 'ZNID-GE-2628A-00-0GN'",
"boot-file-name": “file2"
},
{
"name": "VENDOR_CLASS_ZNID-GE-2624A-00-0GN",
"boot-file-name": “file3"
},
{
"name": "ZNID-GE-2628A-00-0GN",
"test" : "option[60].hex == 'ZNID-GE-2624A-00-0GN'",
"boot-file-name": “file4"
}
],
"subnet4": [
{
"client-class" : "rgw01.lab",
"subnet": "10.63.255.0/24",
"valid-lifetime": 60,
"option-data": [
“client-class”: "VENDOR_CLASS_ZNID-GE-2628A-00-0GN”,
“client-class”: "VENDOR_CLASS_ZNID-GE-2624A-00-0GN”,
{
"name": "tftp-server-name",
"data": "10.63.255.1"
},
{
"name": "classless-static-routes",
"data": "180A20000A3FFF01180A200B0A3FFF01"
}
],
"pools": [
{
"pool": "10.63.255.2 - 10.63.255.254"
}
],
"reservations": [
{
"flex-id": "010972677730312e6c616200040c370201",
"ip-address": "10.63.255.69",
"boot-file-name": “file3"
}
],
},
{
"client-class" : "rgw02.lab",
"subnet": "10.63.254.0/24",
"valid-lifetime": 60,
"option-data": [
“client-class”: "VENDOR_CLASS_ZNID-GE-2628A-00-0GN”,
“client-class”: "VENDOR_CLASS_ZNID-GE-2624A-00-0GN”,
{
"name": "tftp-server-name",
"data": "10.63.254.1"
},
{
"name": "classless-static-routes",
"data": "180A20000A3FFF01180A200B0A3FFF01"
}
],
"pools": [
{
"pool": "10.63.254.2 - 10.63.254.254"
}
],
"reservations": [
{
"flex-id": "010972677730312e6c616200040c370201",
"ip-address": "10.63.254.69",
"boot-file-name": “file3"
}
],
}
]
}
}
Also, and somewhat of an aside, can I edit the "VENDOR_CLASS_" class that is
created by default and insert boot-file-name there, or do I need to create a
different class and match the option 60 specifically?
> On Sep 14, 2017, at 7:38 AM, Francis Dupont <[email protected]> wrote:
>
> Does it not enough to define it globally?
>
> Regards
>
> Francis Dupont <[email protected]>
_______________________________________________
Kea-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-users