I don't presently have DHCPv6 setup in my home network, but my kea server for DHCPv4 seems to be assigning the clients to the vendor classes:
2022-12-01 19:22:40.600 DEBUG [kea-dhcp4.packets/4325.139964547753856] DHCP4_QUERY_DATA [hwtype=1 5c:a6:e6:46:d1:8c], cid=[01:5c:a6:e6:46:d1:8c], tid=0x3d90730c, packet details: local_address=192.168.40.2:67, remote_address=192.168.40.1:67, msg_type=DHCPREQUEST (3), transid=0x3d90730c, options: type=012, len=009: "TL-WA1201" (string) type=053, len=001: 3 (uint8) type=055, len=010: 1(uint8) 3(uint8) 6(uint8) 12(uint8) 15(uint8) 28(uint8) 33(uint8) 42(uint8) 121(uint8) 249(uint8) type=057, len=002: 1024 (uint16) type=060, len=008: "MSFT 5.0" (string) type=061, len=007: 01:5c:a6:e6:46:d1:8c =============================================================== 2022-12-01 19:22:40.592 DEBUG [kea-dhcp4.dhcp4/4325.139964547753856] DHCP4_CLASS_ASSIGNED [hwtype=1 5c:a6:e6:46:d1:8c], cid=[01:5c:a6:e6:46:d1:8c], tid=0x3d90730c: client packet has been assigned to the following class(es): ALL, VENDOR_CLASS_MSFT 5.0, KNOWN =============================================================== Sorry I can't be of more help, but I don't really have anywhere to test DHCPv6 at the moment. On Thu, Dec 1, 2022 at 7:44 AM Xuo Guoto via Kea-users <[email protected]> wrote: > > Hello list, > > I am trying to configure kea dhcpv6 to allocate prefix from a specific pool > based on client classification based on vendor class option. > > The kea config is: (showing only the subnet6 part) > > "subnet6": [ > { > "id": 1, > "subnet": "2404:640:4003:2600::/56", > "pools": [ > { > "pool": "2404:640:4003:2600:0:0:0:1 - > 2404:640:4003:263f:ffff:ffff:ffff:fffe" > } > ], > "pd-pools": [ > { > "prefix": "2404:640:5878:2640::", > "prefix-len": 58, > "delegated-len": 64 > }, > { > "prefix": "2404:640:5878:2680::", > "prefix-len": 58, > "delegated-len": 64 > }, > { > "prefix": "2404:640:5878:26c0::", > "prefix-len": 58, > "delegated-len": 64, > "client-class": "VENDOR_CLASS_dhv6_pool" > } > ], > "option-data": [ > { > "name": "dns-servers", > "data": "2404:640:4003:2640::dead:beef, > 2404:640:4003:2640::cafe:babe" > } > ] > } > ], > > Based on > https://kea.readthedocs.io/en/kea-2.2.0/arm/classify.html?highlight=vendor_class#built-in-client-classes > > <quote> > Some classes are built-in, so they do not need to be defined. Vendor class > information is the primary example: the server checks whether an incoming > DHCPv4 packet includes the vendor class identifier option (60) or an incoming > DHCPv6 packet includes the vendor class option (16). If it does, the content > of that option is prepended with VENDOR_CLASS_ and the result is interpreted > as a class. > </quote> > > I expect that the dhcpv6 clients will be allocated IP from > "2404:640:5878:26c0::" if the option 16 contains the value dhv6_pool, based > on the above explanation. > > The dhcpv6 client sends a packet with following payload: > > localAddr=[::1]:0 remoteAddr=[fd40:761b:fff1:2::3]:546 > msgtype=3(REQUEST), transid=0xdd45f5 > type=00001, len=00010: 00:03:00:01:02:00:00:00:00:01 > type=00002, len=00014: 00:01:00:01:2a:f2:70:1e:5e:b2:d7:b4:94:54 > type=00003(IA_NA), len=00040: iaid=981586272, t1=1800, t2=2880, > options: > type=00005(IAADDR), len=00024: address=2404:640:4003:2600::2, > preferred-lft=3600, valid-lft=300 > type=00006, len=00002: 23(uint16) > type=00008, len=00002: 0 (uint16) > type=16, len=15, enterprise id=0x96xx, data-len0=9, > vendor-class-data0='dhv6_pool' > type=00025(IA_PD), len=00041: iaid=1736983355, t1=1800, t2=2880, > options: > type=00026(IAPREFIX), len=00025: prefix=2404:640:5878:2641::/64, > preferred-lft=3600, valid-lft=300 > 2 relay(s): > relay[0]: msg-type=12(RELAY_FORWARD), hop-count=1, > link-address=fd40:761b:fff1:2::3, peer-address=fd40:761b:fff1:2::2, 0 > option(s) > relay[1]: msg-type=12(RELAY_FORWARD), hop-count=0, > link-address=2404:640:4003:2600::, peer-address=fe80::ffff:ffff:ff00:1, 2 > option(s) > type=00018, len=00004: 00:00:00:04 > type=00079, len=00008: 00:01:02:00:00:00:00:01 > > > But kea is not recognizing the packet to be of class VENDOR_CLASS_dhv6_pool. > Logs show the following: > > 2022-11-30 13:02:02.314 DEBUG [kea-dhcp6.dhcp6/1876234.139694032694912] > DHCP6_CLASS_ASSIGNED duid=[00:03:00:01:02:00:00:00:00:01], tid=0xdd45f5: > client packet has been assigned to the following class(es): UNKNOWN > > Subsequently its getting a prefix from another pool: > > 2022-11-30 13:02:02.314 DEBUG [kea-dhcp6.dhcpsrv/1876234.139694032694912] > DHCPSRV_MEMFILE_ADD_ADDR6 adding IPv6 lease with address 2404:640:5878:2641:: > 2022-11-30 13:02:02.314 INFO [kea-dhcp6.leases/1876234.139694032694912] > DHCP6_PD_LEASE_ALLOC duid=[00:03:00:01:02:00:00:00:00:01], tid=0xdd45f5: > lease for prefix 2404:640:5878:2641::/64 and iaid=1736983355 has been > allocated for 300 seconds > > How can I ensure that the packet is correctly classified so that the address > gets allocated fro the correct pool. > > X. > > -- > ISC funds the development of this software with paid support subscriptions. > Contact us at https://www.isc.org/contact/ for more information. > > To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users. > > Kea-users mailing list > [email protected] > https://lists.isc.org/mailman/listinfo/kea-users -- ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information. To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users. Kea-users mailing list [email protected] https://lists.isc.org/mailman/listinfo/kea-users
