valid-lifetime and required client classes
valid-lifetime and required client classes:
When defining "valid-lifetime" in a client class the value takes precedence over
the global and subnet values. This does not happen when the class is defined as
"only-if-required" and the subnet is defined with "required-client-classes"
The Kea Arm suggests that "option-data" in required classes take precedence but
no mention is made of "valid-lifetime"
Quote: Required evaluation can be used to express complex dependencies like subnet membership. It can also be used to reverse the precedence; if option-data is set in a subnet, it takes precedence over option-data in a class. If option-data is moved to a required class and required in the subnet, a class evaluated earlier may take precedence.
The following offers a lease time with the default value of "7200" and not "123"
for clients classifed as "Class-1"
{
"Dhcp4": {
"interfaces-config": { "interfaces": [ "vethserver" ] },
"control-socket": { "socket-type": "unix", "socket-name": "../sockets/kea4_command" },
"lease-database": { "type": "memfile", "name": "./kea-lease4.csv", "lfc-interval": 0, "persist": true },
"client-classes": [ {
"name": "Class-1", "test": "(pkt4.mac == 0x1e503193e1a6)", "only-if-required": true, "valid-lifetime": 123 }],
"subnet4": [ {
"subnet": "10.0.1.0/24", "id": 1,
"pools": [ { "pool": "10.0.1.5 - 10.0.1.254",
"require-client-classes": [ "Class-1" ] } ] }],
"dhcp-ddns": { "enable-updates": false },
"option-data": [ {
"name": "domain-name-servers", "code": 6, "data": "1.1.1.1" }, {
"name": "routers", "code": 3, "data": "10.0.1.1" } ],
"loggers": [ {
"name": "kea-dhcp4", "output_options": [ { "output": "./kea-dhcp4.log" } ],
"severity": "DEBUG", "debuglevel": 99 } ] }
}