Unstable lease lifetime returns with client classification
It is possible to receive different values for lease lifetimes without altering the configuration if lease lifetimes are specified in the client class as shown in the configuration below
{
"Dhcp6": {
"valid-lifetime": 300,
"preferred-lifetime": 280,
"interfaces-config": {
"interfaces": [ "ens256" ]
},
"lease-database": {
"type": "memfile",
"persist": true,
"name": "/tmp/kea-leases6.csv"
},
"client-classes": [
{
"name": "my-filter-v6",
"test": "option[1].exists",
"preferred-lifetime": 74,
"valid-lifetime": 76
}
],
"subnet6": [
{
"subnet": "2001:db8::/64",
"valid-lifetime": 90,
"preferred-lifetime": 85,
"pools": [
{
"pool": "2001:db8::100-2001:db8::200"
}
]
}
],
"loggers": [
{
"name": "kea-dhcp6",
"output_options": [
{
"output": "/tmp/kea-dhcp6.log"
}
],
"severity": "DEBUG",
"debuglevel": 99
}
]
}
}
Start the server and run perfdhcp: perfdhcp -6 -r 1 -R 100 -l ens256
If the client is added to the class my-filter-v6
, one would expect that the client would receive a valid lifetime of 76 from the class (and it might). Restart the server again (it may help to clear the lease file or just not use persist - I wasn't able to determine if that had any affect), and the client(s) that are in class my-filter-v6
might get 90 as their valid lease lifetime which is from the subnet declaration. Remove the subnet level lease lifetimes and clients that match the class might get lease lifetimes from the class. Restart the server again and the client might get global level lease lifetimes of 300. Remove the global lifetime configurations and the clients might get the lifetimes from the class. Restart again and they might get 7200 which is the default.
It may take several restarts to notice the change.
I tested this on 2.0.3, 2.2.0 and 2.3.3 and the behavior was exhibited in all of those versions. I was not able to reproduce this behavior in kea-dhcp4.