Mismatch in Kea DHCP Subnet Configuration: Unexpected Vendor Class Returned
When I create a subnet in Kea DHCP Database with client class as Vendor_C for the subnet 10.x.x.65/28. It should return the Vendor_C class but I see data of Vendor_N returned everytime. In other words I am expecting the DHCP server to return data sftp://ftp-server:password@ip_address/configs/Vendor_ztp_cen.xml to the DHCP client but it is returning sftp://ftp-server:password@ip_address/configs/Vendor_ztp_ned.xml which is defined under Vendor_N.
My Client classes Configuration defined on the DHCP server.
"client-classes": [
{
"name": "Vendor_N",
"test": "substring(option[60].hex,0,9) == 'Vendor'",
"option-data": [
{
"name": "boot-file-name",
"data": "sftp://ftp-server:password@ip_address/configs/Vendor_ztp_ned.xml"
},
{
"name": "domain-name-servers",
"data": "x.x.x.x,x.x.x.x"
}
]
},
{
"name": "Vendor_C",
"test": "substring(option[60].hex,0,9) == 'Vendor'",
"option-data": [
{
"name": "boot-file-name",
"data": "sftp://ftp-server:password@ip_address/configs/Vendor_ztp_cen.xml"
},
{
"name": "domain-name-servers",
"data": "x.x.x.x,x.x.x.x"
}
]
},
{
"name": "Vendor_W",
"test": "substring(option[60].hex,0,9) == 'Vendor'",
"option-data": [
{
"name": "boot-file-name",
"data": "sftp://ftp-server-pnp:password@ip_address/configs/Vendor_ztp_wst.xml"
},
{
"name": "domain-name-servers",
"data": "x.x.x.x,x.x.x.x"
}
]
}
]
My Payload when adding a subnet##
{ "command": "remote-subnet4-set", "service": ["dhcp4"], "arguments": { "subnets": [ { "id": 12345, "subnet": 10.x.x.65/28, "shared-network-name": "", "pools": [ { "pool": "10.x.x.67- 10.x.x.79", "require-client-classes": ["Vendor_C"] } for pool in pools ], "option-data": [ { "name": "routers", "data": 10.x.x.65 } ] } ], "remote": { "type": "mysql" }, "server-tags": ["all"] } }
DHCP4 log messages
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string 'Vendor'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_EQUAL Popping 0x44726976654E657473 and 0x44726976654E657473 pushing result 'true'
2024-01-02 10:58:30.387 INFO [kea-dhcp4.dhcpsrv/4457.140027448874752] EVAL_RESULT Expression Vendor_N evaluated to 1
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_OPTION Pushing option 60 with value 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '0'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '9'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_SUBSTRING Popping length 9, start 0, string 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137 pushing result 0x44726976654E657473
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string 'Vendor'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_EQUAL Popping 0x44726976654E657473 and 0x44726976654E657473 pushing result 'true'
2024-01-02 10:58:30.387 INFO [kea-dhcp4.dhcpsrv/4457.140027448874752] EVAL_RESULT Expression Vendor_C evaluated to 1
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_OPTION Pushing option 60 with value 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '0'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '9'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_SUBSTRING Popping length 9, start 0, string 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137 pushing result 0x44726976654E657473
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string 'Vendor'
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_EQUAL Popping 0x44726976654E657473 and 0x44726976654E657473 pushing result 'true'
2024-01-02 10:58:30.387 INFO [kea-dhcp4.dhcpsrv/4457.140027448874752] EVAL_RESULT Expression Vendor_W evaluated to 1
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.packets/4457.140027448874752] DHCP4_PACKET_RECEIVED [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: DHCPREQUEST (type 3) received from 10.x.x.37 to 100.91.x.x on interface ens160
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.packets/4457.140027448874752] DHCP4_QUERY_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5, packet details: local_address=100.x.x.226:67, remote_address=10.x.x.37:68, msg_type=DHCPREQUEST (3), transid=0x758adfb5,
options:
type=012, len=015: "WKY1C7VH0001AP2" (string)
type=053, len=001: 3 (uint8)
type=055, len=015: 1(uint8) 121(uint8) 3(uint8) 6(uint8) 12(uint8) 15(uint8) 28(uint8) 33(uint8) 51(uint8) 54(uint8) 58(uint8) 59(uint8) 66(uint8) 67(uint8) 119(uint8)
type=057, len=002: 8972 (uint16)
type=060, len=041: "Vendor-Ufi_Space_S9710-76D-R-18.2.0.17" (string)
type=061, len=020: 00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32
type=124, len=21, enterprise id=0xc24b, data-len0=16, vendor-class-data0='Vendor-BaseOS'
type=145, len=001: 01
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_SUBNET4_SELECT_NO_RAI_OPTIONS No RAI options found to use for subnet selection.
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_SUBNET4_SELECT_NO_RELAY_ADDRESS Relay address (giaddr) in client packet is empty.
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_CFGMGR_SUBNET4_ADDR selected subnet 10.28.16.33/28 for packet received by matching address 10.x.x.37
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.packets/4457.140027448874752] DHCP4_SUBNET_SELECTED [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: the subnet with ID 2406630306 was selected for client assignments
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.packets/4457.140027448874752] DHCP4_SUBNET_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: the selected subnet details: 10.28.16.33/28
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv4 reservation for subnet id 2406630306, identified by hwaddr=8440761A7A39
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: hwaddr=8440761A7A39
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier hwaddr=8440761A7A39, found 0 host(s)
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 2406630306 and identifier hwaddr=8440761A7A39
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv4 reservation for subnet id 2406630306, identified by client-id=006E63632D574B59314337564830303031415032
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: client-id=006E63632D574B59314337564830303031415032
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier client-id=006E63632D574B59314337564830303031415032, found 0 host(s)
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 2406630306 and identifier client-id=006E63632D574B59314337564830303031415032
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcp4/4457.140027448874752] DHCP4_CLASS_ASSIGNED [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: client packet has been assigned to the following class(es): UNKNOWN
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcp4/4457.140027448874752] DHCP4_CLASS_ASSIGNED [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: client packet has been assigned to the following class(es): ALL, HA_prod-kea-1, VENDOR_CLASS_Vendor-Ufi_Space_S9710-76D-R-18.2.0.17, Vendor_N, Vendor_C, Vendor_W, UNKNOWN
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.ddns/4457.140027448874752] DHCP4_CLIENT_HOSTNAME_PROCESS [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: processing client's Hostname option
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.ddns/4457.140027448874752] DHCP4_CLIENT_HOSTNAME_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: client sent Hostname option: WKY1C7VH0001AP2
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.ddns/4457.140027448874752] DHCP4_CLIENT_HOSTNAME_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: client sent Hostname option: WKY1C7VH0001AP2
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.ddns/4457.140027448874752] DHCP4_RESPONSE_HOSTNAME_DATA [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: including Hostname option in the server's response: wky1c7vh0001ap2
2024-01-02 10:58:30.387 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_MYSQL_GET_CLIENTID obtaining IPv4 leases for client ID 00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4 get one host with reservation for subnet id 2406630306 and IPv4 address 10.x.x.37
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_ADDRESS4 get all hosts with reservations for IPv4 address 10.x.x.37
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ALL_ADDRESS4_COUNT using address 10.x.x.37, found 0 host(s)
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.hosts/4457.140027448874752] HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS4_NULL host not found using subnet id 2406630306 and address 10.x.x.37
2024-01-02 10:58:30.461 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_MYSQL_GET_ADDR4 obtaining IPv4 lease for address 10.x.x.37
2024-01-02 10:58:30.535 DEBUG [kea-dhcp4.alloc-engine/4457.140027448874752] ALLOC_ENGINE_V4_REQUEST_EXTEND_LEASE [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: extending lifetime of the lease for address 10.x.x.37
2024-01-02 10:58:30.535 DEBUG [kea-dhcp4.dhcpsrv/4457.140027448874752] DHCPSRV_MYSQL_UPDATE_ADDR4 updating IPv4 lease for address 10.x.x.37
2024-01-02 10:58:30.611 INFO [kea-dhcp4.leases/4457.140027448874752] DHCP4_LEASE_ALLOC [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: lease 10.x.x.37 has been allocated for 43200 seconds
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_OPTION Pushing option 60 with value 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '0'
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string '9'
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_SUBSTRING Popping length 9, start 0, string 0x44726976654E6574732D5566695F53706163655F53393731302D3736442D522D31382E322E302E3137 pushing result 0x44726976654E657473
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_STRING Pushing text string 'Vendor'
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.eval/4457.140027448874752] EVAL_DEBUG_EQUAL Popping 0x44726976654E657473 and 0x44726976654E657473 pushing result 'true'
2024-01-02 10:58:30.611 INFO [kea-dhcp4.dhcp4/4457.140027448874752] EVAL_RESULT Expression Vendor_C evaluated to 1
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.callouts/4457.140027448874752] HOOKS_CALLOUTS_BEGIN begin all callouts for hook leases4_committed
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.callouts/4457.140027448874752] HOOKS_CALLOUT_CALLED hooks library with index 8 has called a callout on hook leases4_committed that has address 0x7f5ab16500f0 (callout duration: 0.034 ms)
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.callouts/4457.140027448874752] HOOKS_CALLOUTS_COMPLETE completed callouts for hook leases4_committed (total callouts duration: 0.034 ms)
2024-01-02 10:58:30.611 DEBUG [kea-dhcp4.options/4457.140027448874752] DHCP4_PACKET_PACK [hwtype=1 84:40:76:1a:7a:39], cid=[00:6e:63:63:2d:57:4b:59:31:43:37:56:48:30:30:30:31:41:50:32], tid=0x758adfb5: preparing on-wire format of the packet to be sent
2024-01-02 10:55:29.629 DEBUG [kea-dhcp4.packets/4457.140027482445568] DHCP4_RESPONSE_DATA [hwtype=1 84:c4:21:1e:c0:fc], cid=[00:63:6c:75:73:74:65:72:2d:57:4b:59:31:43:38:56:4e:30:30:30:31:38:50:32:5f:77:61], tid=0x2252e631: responding with packet DHCPACK (type 5), packet details: local_address=100.91.x.x:67, remote_address=10.28.x.x:68, msg_type=DHCPACK (5), transid=0x2252e631,
options:
type=001, len=004: 4294967280 (uint32)
type=003, len=004: 10.x.x.33
type=006, len=008: x.x.x.x x.x.x.x
type=051, len=004: 43200 (uint32)
type=053, len=001: 5 (uint8)
type=054, len=004: 100.x.x.x
type=058, len=004: 21600 (uint32)
type=059, len=004: 32400 (uint32)
type=061, len=027: 00:63:6c:75:73:74:65:72:2d:57:4b:59:31:43:38:56:4e:30:30:30:31:38:50:32:5f:77:61
type=067, len=075: "sftp://ftp-server:password@ip_address/configs/vendor_ztp_ned.xml" (string)
Thanks, Sandeep