[Kea-users] KEA allocates an IP while it should not

Veronique Lefebure veronique.lefebure at cern.ch
Tue Aug 30 10:30:43 UTC 2022


 Hi, 


 I would like to understand why KEA allocates an IP which should not be allocated. 


 I have, on purpose (for testing KEA behaviour), declared the following global host reservation: 


 { 
"boot-file-name": "", 
"client-classes": [ ], 
"hostname": "cs-test-1a", 
"hw-address": "xx:xx:xx:xx:ff:3e", 
"ip-address": "yyy.yyy.yyy.11", 
"next-server": "0.0.0.0", 
"option-data": [ ], 
"server-hostname": "", 
"user-context": {""} 
}, 





 IP address "yyy.yyy.yyy.11" is part of a subnet which is NOT configured in kea-dhcp4.conf. 


 The client, with mac "xx:xx:xx:xx:ff:3e" , requests an IP from a subnet which is correctly identified by KEA, KEA will first allocate the IP (although it should not because it is not part fo that subnet), and then in a later step, KEA will send a NACK. 
 See logs below. 


 My question is: 
 ISC DHCP would not do that. 
 ISC DHCP would allocate an IP from a pool of the selected subnet because the reserved IP does not match. 
 Is it expected that KEA does not behave the same way ? 
 Is there any tuning that can be used so that KEA behaves the same way as ISC DHCP used to behave ? 


 Thanks, 
 Veronique 




 logs: 


 # DISCOVER 



 2022-08-30 11:53:03.131 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_PACKET_RECEIVED [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: DHCPDISCOVER (type 1) received from my_router_ip to my_kea_server_ip on interface enp3s0f0 

2022-08-30 11:53:03.132 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_SUBNET_SELECTED [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: the subnet with ID 2887444672 was selected for client assignments 



 2022-08-30 11:53:03.133 DEBUG [kea-dhcp4.alloc-engine/21553.140195413911744] ALLOC_ENGINE_V4_DISCOVER_HR client [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b sending DHCPDISCOVER has reservation for the address yyy.yyy.yyy.11 



 # OFFER  


 2022-08-30 11:53:03.133 INFO [kea-dhcp4.leases/21553.140195413911744] DHCP4_LEASE_ADVERT [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: lease yyy.yyy.yyy.11 will be advertised 



 2022-08-30 11:53:03.133 DEBUG [kea-dhcp4.options/21553.140195413911744] DHCP4_PACKET_PACK [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: preparing on-wire format of the packet to be sent 
2022-08-30 11:53:03.133 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_PACKET_SEND [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: trying to send packet DHCPOFFER (type 2) from my_kea_server_ip:67 to my_router_ip:67 on interface enp3s0f0 



 # REQUEST  


 2022-08-30 11:53:03.608 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_PACKET_RECEIVED [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: DHCPREQUEST (type 3) received from my_router_ip to my_kea_server_ip on interface enp3s0f0 



 2022-08-30 11:53:03.611 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_SUBNET_SELECTED [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: the subnet with ID 2887444672 was selected for client assignments 



 2022-08-30 11:53:03.612 DEBUG [kea-dhcp4.alloc-engine/21553.140195413911744] ALLOC_ENGINE_V4_REQUEST_ALLOC_REQUESTED [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: trying to allocate requested address yyy.yyy.yyy.11 



 # ACK  


 2022-08-30 11:53:03.612 INFO [kea-dhcp4.leases/21553.140195413911744] DHCP4_LEASE_ALLOC [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: lease yyy.yyy.yyy.11 has been allocated for 242 seconds 



 2022-08-30 11:53:03.613 DEBUG [kea-dhcp4.options/21553.140195413911744] DHCP4_PACKET_PACK [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: preparing on-wire format of the packet to be sent 
2022-08-30 11:53:03.613 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_PACKET_SEND [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: trying to send packet DHCPACK (type 5) from my_kea_server_ip:67 to my_router_ip:67 on interface enp3s0f0 




 # 2nd REQUEST but this time subnet selection fails 


 2022-08-30 11:54:44.178 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_PACKET_RECEIVED [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: DHCPREQUEST (type 3) received from yyy.yyy.yyy.11 to my_kea_server_ip on interface enp3s0f0 



 2022-08-30 11:54:44.180 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_SUBNET_SELECTION_FAILED [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: failed to select subnet for the client 



 2022-08-30 11:54:44.181 ERROR [kea-dhcp4.bad-packets/21553.140195413911744] DHCP4_PACKET_NAK_0001 [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: failed to select a subnet for incoming packet, src yyy.yyy.yyy.11, type DHCPREQUEST 



 # NACK 


 2022-08-30 11:54:44.181 DEBUG [kea-dhcp4.options/21553.140195413911744] DHCP4_PACKET_PACK [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: preparing on-wire format of the packet to be sent 
2022-08-30 11:54:44.181 DEBUG [kea-dhcp4.packets/21553.140195413911744] DHCP4_PACKET_SEND [hwtype=1 xx:xx:xx:xx:ff:3e], cid=[no info], tid=0xa4a8ab1b: trying to send packet DHCPNAK (type 6) from my_kea_server_ip:67 to yyy.yyy.yyy.11:68 on interface enp3s0f0 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20220830/ac49559c/attachment.htm>


More information about the Kea-users mailing list