[Kea-users] option 82 based class for lease limits

Marcin Siodelski marcin at isc.org
Tue Oct 4 11:15:15 UTC 2016


On 25.09.2016 02:38, John Ratliff wrote:
> Can you limit the number of addresses a client is assigned based on option
> 82 (DHCP Relay Agent Information) circuit or remote ID?
>
> I work for a small ISP that is considering using kea in place of isc-dhcp.
> However, we need to limit our customers to a single lease per household.
> Right now, we have a custom class in isc-dhcp which can do this.
>
> class "Internet" {
>     spawn with pick-first-value (option agent.circuit-id, option
> agent.remote-id, circuit-id, remote-id);
>     if (exists agent.remote-id) { set remote-id = option
> agent.remote-id; }
>     if (exists agent.circuit-id) { set circuit-id = option
> agent.circuit-id; }
>     lease limit 1;
> }
>
> How could we do something similar using kea?
>

John,

We don't have a generic support for limiting leases based on values from
option 82.

It could be implemented using Kea hooks framework, which would require
writing a hook library and attach it to the lease4_select hook point.

The problematic part, though, is that we don't track circuit-ids and/or
remote-ids in the lease database. The hook library would need to
maintain its own lease storage (perhaps an STL container) associating
the remote-ids/circuit-ids with client-ids. When the client changes its
client identifier or MAC address the hook library could use this
container to search for the recorded client-id using a
circuit-id/remote-id as a key. If the client-id has changed, the lease
is not granted. Instead, it could return an existing lease or no lease,
depending on the desired effect.

More about hooks framework is available in Kea Developer's Guide:
https://jenkins.isc.org/job/Fedora20_32_doxygen_doc/doxygen/

Marcin Siodelski
ISC




More information about the Kea-users mailing list