[Kea-users] dhcpv6 reservations by interface-id

Tomek Mrugalski tomasz at isc.org
Mon Jun 5 20:12:10 UTC 2017


W dniu 05.06.2017 o 10:59, Christian Kratzer pisze:
> Hi,
> 
> we currently use following in isc dhcp 4.3.5 to assign static prefixes
> to customers via dhcpv6 option 18 interface-id:
> 
>     host lineid-12345-prefix6 {
>         host-identifier v6relopt 1 dhcp6.interface-id "Kneid-12345";
>         fixed-prefix6 2001:db:1200:0300::/56;
>     }
> 
> I cannot find from the documentation how above could be translated to kea.
> 
> We can have upto 3 interface-id relay options inserted via the various
> ldra agents between the customer cpe and the dhcp server.
> 
> The interesting option is the one nearest to the client which is added
> by the ldra agent on the l2 access switch at the edge of our network.  
> Our cisco l3 relay agents also add an interface-id option at an outer
> level but that is of no use to identifiy a single customer.
> 
> We use the v6relopt function new in ISC dhcp 4.3.5 to match the relay
> options nearest to the client.
> 
> Is above possible in current KEA or would we have to resort to hooks to
> implement this ?
This should be possible with flexible Identifier hook. You would need to
do the following:

1. load flex-id hook and pecify what you want to use as a host identifier:

"hooks-libraries": [
    {
        "library": "libdhcp_flex_id.so",
        "parameters": {
            "identifier-expression": "relay6[2].option[18].hex"
        }
    }
]

The identifier expression defines what you want to use to identify a
host. This particular example means: look at the options inserted by the
third relay (0 is the first one, 1 is the second, 2 is third), counting
from the server side. From those options, take option 18 (interface-id)
and use it as binary (hex).

2. Then you'd have something like this to mimic your example:

"reservations": [
    {
        "flex-id": "'Kneid-12345'",
        "prefixes": [ "2001:db:1200:0300::/56" ]
    }
]

3. Finally, you need to tell Kea to use flex-id as identifiers for
incoming packets. This should do the trick:

"host-reservation-identifiers": [ "duid", "hw-address", "flex-id" ]

Flex-id is described in User's Guide, section 14.3.3, but also there's a
nice short doc about it here: isc.org/kea.

Hope that helps,
Tomek Mrugalski
ISC



More information about the Kea-users mailing list