Print warning if subnet IDs do not exist in one or more subnets
- name: Warn about missing subnet IDs
- about: Print a warning at startup if subnet IDs are not configured with one or more subnets
If subnet IDs are not added to the configuration, then strange behaviors can happen when the subnet order is changed or a new subnet is added. Consider this partial configuration:
"subnet4": [
{
"subnet": "10.1.3.0/24",
"pools": [
{
"pool": "10.1.3.100 - 10.1.3.200"
}
]
},
{
"subnet": "10.1.2.0/24",
"pools": [
{
"pool": "10.1.2.100 - 10.1.2.200"
}
]
}
]
Client gets a lease as recorded in the leases file:
10.1.2.124,00:0c:29:9e:4f:41,,300,1684442616,2,0,0,perfdhcp1,0,
Note that the subnet id recorded was 2. Now re-order the subnets:
"subnet4": [
{
"subnet": "10.1.2.0/24",
"pools": [
{
"pool": "10.1.2.100 - 10.1.2.200"
}
]
},
{
"subnet": "10.1.3.0/24",
"pools": [
{
"pool": "10.1.3.100 - 10.1.3.200"
}
]
}
]
Now the client comes back and requests the previous address 10.1.2.124
and receives a NAK. Then a discover follows and a new address is allocated with the new subnet id of 1:
10.1.2.120,00:0c:29:9e:4f:41,,300,1684442746,1,0,0,perfdhcp1,0,
The above example was produced with Kea 2.3.7 using memfile lease-database. The problems get much worse if there are multiple Kea servers using a shared mysql or postgres lease-database.
A WARNING printed when the server starts and one or more subnets are missing a subnet ID in the style of the one printed for the development versions:
2023-05-18 20:52:41.379 WARN [kea-dhcp4.dhcp4/243124.281473000751120] DHCP4_DEVELOPMENT_VERSION This software is a development branch of Kea. It is not recommended for production use.
would help with this situation. Many administrators may not be aware of the problems this can cause.