kea-dhcp4 behaviour question client-class vs reservations
Jan-Philipp Snizek
jan-philipp.snizek at business.uzh.ch
Fri Apr 26 09:05:22 UTC 2024
Hi
I would like to ask a question regarding precedence behavior of kea-dhcp4.
Let's take this working config:
"client-classes": [
{
"name": "pxeclientx64",
"test": "option[60].text == 'PXEClient:Arch:00007:UNDI:003016'",
"option-data": [
{ "name": "vendor-encapsulated-options", "always-send": false },
{ "name": "boot-file-name", "data": "SMSBoot\\x64\\wdsmgfw.efi" },
{ "name": "tftp-server-name", "code": 66, "data": "my-tftp-server.domain.local" }
]
}
],
"subnet4": [
{
"id": 1,
"subnet": "172.20.19.0/24",
"next-server": "172.20.19.1",
"pools": [
{ "pool": "172.20.19.120 - 172.20.19.129" },
{ "pool": "172.20.19.130 - 172.20.19.139", "client-class": "pxeclientx64" }
],
"reservation-mode": "out-of-pool",
"reservations": [
{ "hostname": "pxeboot1", "hw-address": "00:e0:4c:68:0a:f1", "ip-address": "172.20.19.150" }
],
"option-data": [
{ "name": "routers", "data": "172.20.19.1" }
]
}
],
If the client with the reservation executes a PXE boot it gets the reserved IP .19.150 and successfully boots PXE.
The kea-dhcp4 log looks like this:
Apr 25 13:53:17 hellbox kea-dhcp4[16858]: INFO EVAL_RESULT Expression pxeclientx64 evaluated to 1
Apr 25 13:53:17 hellbox kea-dhcp4[16858]: INFO DHCP4_LEASE_ADVERT [hwtype=1 00:e0:4c:68:0a:c1], cid=[no info], tid=0x2223e0e3: lease 172.20.19.150 will be advertised
Apr 25 13:53:20 hellbox kea-dhcp4[16858]: INFO EVAL_RESULT Expression pxeclientx64 evaluated to 1
Apr 25 13:53:20 hellbox kea-dhcp4[16858]: INFO DHCP4_LEASE_ALLOC [hwtype=1 00:e0:4c:68:0a:c1], cid=[no info], tid=0x2223e0e3: lease 172.20.19.150 has been allocated for 3600 seconds
As we can see both matches: pxeclientx64 and the reservation. The client successfully boots pxe.
I don't understand why the client successfully pxe boots. The client-class "pxeclientx64" is assigned to a pool. It is neither assigned to the subnet4 { id: 1 } subnet declaration nor to the reservation.
What has precedence over what? How does inheritance work in kea?
Thanks,
--
Philipp
More information about the dhcp-users
mailing list