Hi,
Thanks, this might work. Just for the record, if the identifier is a 62 char string. Would it be an issue? Is there any limitations? ________________________________ Fra: Marcin Siodelski <[email protected]> Sendt: 13. april 2018 17:04:41 Til: Frode Sætre; [email protected] Emne: Re: [Kea-users] Circuit-ID On 02.02.2018 09:25, Frode Sætre wrote: > > We want to identify leases with circuit ID, how can we get the circuit > ID with the lease4-get? > > > > Vennlig hilsen / Best regards > > > Frode Sætre > > > Frode, I realize that this is quite an old thread, but from our most recent correspondence via Kea dev I know that this issue still hasn't been resolved. We have created Kea ticket for you https://kea.isc.org/ticket/5592. This ticket is currently out of scope for the upcoming release as this is really a broader problem of how to easily associate any custom data with a lease, without having to update lease database schema every time we add a new parameter. As of today, the circuit id is not stored in the lease database and therefore there is no way to query for leases by circuit id, with one exception I discuss below. The only way to achieve what you want is to use 'flex-id' hook library which is available as part of our premium offering: https://www.isc.org/kea/ This library allows for specifying a custom expression which constitutes flexible identifier by which static host reservations can be identified. In particular, you may define an expression which uses circuit-id from the received DHCP query as an identifier to lookup host reservations for the client which sent this query. This library has one more feature which is going to be useful for your case. Setting "replace-client-id" to true in the library configuration will cause the library to replace client identifier option sent by the client with your custom identifier, e.g. circuit-id and store it in the lease database instead of the client identifier when the lease is allocated. The value of the circuit-id will be prefixed with hexadecimal "00". Assuming that the circuit-id value is "54:64:45:66". If the "replace-client-id" is set to true, the lease will be stored and the client-id value stored in the lease database will be "00:54:64:45:66". Now, you can query for this lease in the following way: { "command": "lease4-get", "arguments": { "identifier-type": "client-id", "identifier": "00:54:64:45:66", "subnet-id": 44 } } Note that the identifier type is "client-id", but the value you put under "identifier" is your circuit-id prefixed with 00. This exact case is described in the Kea User's Guide: https://jenkins.isc.org/job/Kea_doc/guide/kea-guide.html#flex-id This is the expression you may use for your custom identifier: "identifier-expression": "relay4[1].hex" which creates it from the relay agent sub option 1. Hope that helps, Marcin Siodelski ISC
_______________________________________________ Kea-users mailing list [email protected] https://lists.isc.org/mailman/listinfo/kea-users
