[Kea-users] from dhcpd to kea; classes and subclasses

Tomek Mrugalski tomasz at isc.org
Thu Feb 23 20:16:57 UTC 2017


W dniu 23.02.2017 o 13:58, Philippe Maechler pisze:
>
> Hello Kea-Users
>
>  
>
> We’re running two pairs of dhcpd in our cable and fibre network. The
> setup or the config file gets more and more complex and hard to debug
> or make new stuff.
>
> Since we want to use reserved leases and often have to end a lease
> before it expires, we’re thinking about using kea.
>
> The last time I looked at kea was before class support was available,
> which we also heavily rely on. Meanwhile kea supports classes and I
> think it’s worth a try ;)
>
>  
>
> A few questions arise before I try to merge our current configuration:
>
> 1.     For our fiber network we have a group with global options.
> Inside the group we have several hosts
>
> e.g:
>
> group {
>
>        option vendor-encapsulated-options = "s=<SERVERIP>;v=<VLANID>";
>
> host CATV_000001_ONT{hardware ethernet 0:11:22:33:44:10;}
>
> host CATV_000002_ONT{hardware ethernet 0:11:22:33:44:20;}
>
> host CATV_000003_ONT{hardware ethernet 0:11:22:33:44:30;}
>
>>
> }
>
> Are groups supported in kea? In dhcpd we’re using a class for each
> option-82 and provide global options inside a group.
>
No, but you can get similar functionality with classes. You can define a
class with option values and then assign host reservations to specific
class.
>
>  
>
> 2.     Each customer (or each option-82) gets one (1) IPv4 address, an
> IPv6 address an an IPv6-Prefix/56. There are a few cases when a
> customer gets 2, 3 or sometimes 4 addresses. We solved this with
> dynamic subclasses
>
> // native vlan, only used when the cpe boots
>
> class "CATV_000001_Port" {
>
> match if ( substring ( option agent.circuit-id, 0, 25 )      =
> "gaswXXX003 eth <UNIT>/<PORT>" );
>
> match hardware;
>
> }
>
> // voice vlan, only if the customer has voice
>
> class "CATV_000001_Voice" {
>
> match if ( substring ( option agent.circuit-id, 0, 30 )    =
> "gaswXXX003 eth <UNIT>/<PORT>:<VLANDI>" );
>
> spawn with option agent.circuit-id;
>
> lease limit 2;
>
> }
>
> // data / HSI vlan
>
> class "CATV_000001_CPE_DHCP"   {
>
> match if ( substring ( option agent.circuit-id, 0, 30 )       =
> "gaswXXX003 eth <UNIT>/<PORT>: <VLANDI>" " );
>
> *spawn with option agent.circuit-id; *
>
> *lease limit 1;*
>
> }
>
> I haven’t seen anything regarding subclasses in the kea admin guide.
> Is this setup possible or are there any other methods to achive this?
>
Long time ago Shawn Routhier explained that sub-classes were implemented
in dhcpd as performance optimization thing. There is not and there
likely won't be support for sub-classes in Kea.

What does the XXX stand in each class above? Are they the same or
different for each subclasses? If they're different, you can define
three separate reservations for it. Not sure if I read it correctly, but
subclass 2 and 3 have the same first 30 bytes of the circuit-id. Is that
correct?

>  
>
> 3.     Are static addresses based on the option-82 and not the mac
> address available in kea?
>
> e.g
>
> host ABCD {
>
> option agent.circuit-id = “gaswXXX003 eth <UNIT>/<PORT>:<VLANID>”;
>
> ipaddress = 10.1.2.3;
>
> }
>
> /I didn’t check the syntax of that/
>
You can have the reservation in v4 based on one of the following:
hw-address (that's hardware address set by the client in its packet),
duid (some clients can put their DUID within client-id), client-id
(that's an option inserted by a client) and circuit-id (that's the
agent.circuit-id option). That's described here:
https://jenkins.isc.org/job/Kea_doc/guide/kea-guide.html#host-reservation-v4

For v6 we support reservations by duid and hw-address. However, you can
specify where the hw-address should come from and we currently support
duid, ipv6-link-local (both are set by the client) and several options
inserted by relays: client-link-addr-option, remote-id, subscriber-id,
docsis-cmts, docsis-modem.

General description of v6 reservations:
https://jenkins.isc.org/job/Kea_doc/guide/kea-guide.html#host-reservation-v6

Description how to make Kea treat various options as MAC addresses.
https://jenkins.isc.org/job/Kea_doc/guide/kea-guide.html#mac-in-dhcpv6

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


More information about the Kea-users mailing list