[Kea-users] Saving additional information on the lease info

Tomek Mrugalski tomasz at isc.org
Mon Mar 27 14:24:42 UTC 2017


On 27/03/17 08:27, Egi K wrote:
> What I would like to achieve is storing also the interface-ID on the
> lease entries when i am using prefix delegations. Because i can see the
> lease information for the end client, but i cant find out a way to
> relate this end-client to the device which is currently doing the prefix
> delegation.
There is no way to do it out of the box. Depending on what you need this
information for, there are couple options. First, if you need it for
legal or audit purposes, you may be interested in Forensic logging
library. It stores extra information, including interface-id in
dedicated audit log files.

If you want to store the information in the DB, probably the easiest way
would be to write a hook for pkt6_send. You could extract the lease
information from the response6 packet and the value of interface-id from
query6. At that stage the lease is already in the DB, so you could do:

 UPDATE lease6 SET extra_info=... WHERE address=...

This is not the optimal solution from the performance perspective (you'd
have 2 queries for each lease addition/update/delete), but it's probably
the easiest to implement.

> Is there any possibility to store this additional info?
Not with the current code.

You can consider those two options above. If neither of them work for
you, we can talk about other options. The key question is how badly do
you need this feature?

Tomek




More information about the Kea-users mailing list