[Kea-users] Templates or Reference (kea 1.2.0)

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

[Kea-users] Templates or Reference (kea 1.2.0)

Jason Lixfeld
Hi there,

Is there a way to create a template or reference whereby multiple subnets (or anything, really) could refer to some other part of the configuration for an option?

For example:

“dhcp4” : {
        “template:” [
                {
                        “name”: “foo”,
                        “boot-file-name”: “bar”
                }
        ],
        “subnet4": [
                {
                        “subnet”: “10.0.0.0/24”,
                        “option-data”: [
                                {
                                        “template": “foo”
                                },
                                {
                                        “boot-file-name”: "par"
                                }
                        ]
                       
                }
        ]
}

In the example above, I have a subnet (assume in production there will be multiple subnets), and I wanted the subnet(s) to have a boot-file-name referenced centrally, unless there is a boot-file explicitly configured in the subnet, then it would use that one.

Thanks!

_______________________________________________
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] Templates or Reference (kea 1.2.0)

Francis Dupont
Does it not enough to define it globally?

Regards

Francis Dupont <[hidden email]>
_______________________________________________
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] Templates or Reference (kea 1.2.0)

Jason Guy
Generally the workflow here is to define the common settings globally, then override a given setting within the subnet context. Most deployments would only have a few exceptions, like default router is typically different per subnet.

HTH...

On Thu, Sep 14, 2017 at 7:38 AM, Francis Dupont <[hidden email]> wrote:
Does it not enough to define it globally?

Regards

Francis Dupont <[hidden email]>
_______________________________________________
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] Templates or Reference (kea 1.2.0)

Francis Dupont
> On Thu, Sep 14, 2017 at 7:38 AM, Francis Dupont <[hidden email]> wrote:
>
> > Does it not enough to define it globally?
>
> Jason Guy writes:
> Generally the workflow here is to define the common settings globally, then
> override a given setting within the subnet context. Most deployments would
> only have a few exceptions, like default router is typically different per
> subnet.

=> it seems I can conclude that it is enough (i.e. yes answer to
my question)...

Regards

Francis Dupont <[hidden email]>
_______________________________________________
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] Templates or Reference (kea 1.2.0)

Jason Lixfeld
In reply to this post by Francis Dupont
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 <[hidden email]> wrote:

Does it not enough to define it globally?

Regards

Francis Dupont <[hidden email]>


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users