[Kea-users] Classless static routes?

Tomek Mrugalski tomasz at isc.org
Mon Oct 3 14:23:22 UTC 2016

W dniu 30.09.2016 o 23:08, Sylvan Miles pisze:
> Is it possible to hand out classless static routes with Kea (I’m
> running 1.1.0)?
Sure. Kea does not provide its definition, but you can do that easily
with custom option defintions.
> DHCP option 121 under defined under RFC3442.
> If not, is it on the roadmap or can it be added as a feature request?
It currently isn't. We can do custom option for now, but it would be
useful to have proper support for it. Can you create a new ticket for
it? Please go to kea.isc.org, log in (create an account if you don't
have one) and create new ticket for it. We will triage it and assign to
a milestone.
> If so, what would the relevant kea.conf look like?
There are couple ways you can get it. The one you provided - to define
everything as integers - would surely work, but it's a bit cumbersome.
Here's a slightly more convenient one:

    "option-def": [
        "name": "classless-static-routes",
        "code": 121,
        "space": "dhcp4",
        "type": "record",
        "record-types": "uint8,uint8,uint8,ipv4-address"

    "option-data": [
        "name": "classless-static-routes",
        "data": "9,10,0,"

You can probably skip the "space:" "dhcp4" part, but I have not tested
it. If you want to add multiple entries in that option, adding "array":
true may be useful.

The option-def has to be defined in the global scope of Dhcp4, while
option-data can be defined anywhere you need it: in the global or subnet
scope or even in host reservations if you want to provide different
values to different hosts.

The definition above assumes that the netmask will be between 9 and 16,
so the actual network part will be encoded on 2 bytes, hence the
uint8,uint8,uint8. If you want to define for example, you'd
need to use "uint8,uint8, ipv4-address".

If you want to know more, this topic is discussed in detail in the Kea
User's Guide, in section 7.2.9 "Custom option definitions". You probably
want to take a look at the Table 7.3, too.

If you need a full working example, I have uploaded one here:

Hope that helps.

Tomek Mrugalski

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20161003/36532866/attachment.htm>

More information about the Kea-users mailing list