[Kea-users] DHCPv4 host reservations not working in 1.0.0-git?

Klaus Steden klausfiend at gmail.com
Sun May 29 11:56:10 UTC 2016


Hi there,

I'm trying to use the latest Git revision of Kea (e7c3e4b) and I think I'm
running into a bug. I'm hoping someone can help me with a sanity check.

My configuration is still super basic as I'm currently doing R&D, but it
seems to be the case that kea-dhcp4 in 1.0.0-git is ignoring host
reservations stored in MySQL.

Here's my config:

-- cut --
{
"Dhcp4": {
"interfaces-config": {
"interfaces": ["eth0"]
},
"lease-database": {
"type": "mysql",
"host": "localhost",
"name": "******",
"user": "******",
"password": "******"
},
"hosts-database": {
"type": "mysql",
"host": "localhost",
"name": "******",
"user": "******",
"password": "******"
},
"client-classes": [{
"name": "iPXE",
"test": "option[77].exists and option[77].hex == 'iPXE'",
"option-data": [{
"name": "boot-file-name",
"data": "http://******/api/provision"
}]
}, {
"name": "bootstrap",
"test": "option[60].exists and not(option[77].exists)",
"option-data": [{
"name": "boot-file-name",
"data": "ipxe/undionly.kpxe"
}]
}, {
"name": "renew",
"test": "option[50].exists"
}],
"expired-leases-processing": {
"reclaim-timer-wait-time": 10,
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"unwarned-reclaim-cycles": 5
},
"valid-lifetime": 4000,
"subnet4": [{
"subnet": "10.129.129.0/29",
"id": 1,
"pools": [{
"pool": "10.129.129.2 - 10.129.129.6"
}],
"option-data": [{
"name": "routers",
"data": "10.129.129.1"
}]
}, {
"subnet": "10.129.129.8/29",
"id": 2,
"pools": [{
"pool": "10.129.129.10 - 10.129.129.14"
}],
"option-data": [{
"name": "routers",
"data": "10.129.129.9"
}]
}]
},
"Dhcp6": {
"interfaces-config": {
"interfaces": ["eth0"]
},
"lease-database": {
"type": "mysql",
"host": "localhost",
"name": "******",
"user": "******",
"password": "******"
},
"hosts-database": {
"type": "mysql",
"host": "localhost",
"name": "******",
"user": "******",
"password": "******"
},
"expired-leases-processing": {
"reclaim-timer-wait-time": 10,
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"unwarned-reclaim-cycles": 5
},
"preferred-lifetime": 3000,
"valid-lifetime": 4000,
"renew-timer": 1000,
"rebind-timer": 2000,
"subnet6": []
},
"DhcpDdns": {
"ip-address": "127.0.0.1",
"port": 53001,
"tsig-keys": [],
"forward-ddns": {},
"reverse-ddns": {}
},
"Logging": {
"loggers": [{
"name": "kea-dhcp4",
"output_options": [{
"output": "/var/log/kea-dhcp4.log"
}],
"severity": "DEBUG",
"debuglevel": 99
}, {
"name": "kea-dhcp6",
"output_options": [{
"output": "/var/log/kea-dhcp6.log"
}],
"severity": "INFO",
"debuglevel": 0
}, {
"name": "kea-dhcp-ddns",
"output_options": [{
"output": "/var/log/kea-ddns.log"
}],
"severity": "INFO",
"debuglevel": 0
}]
}
}
-- cut --

Lease information is being updated, so I know that it's talking to MySQL;
if I intentionally set an incorrect password on the hosts-database stanza,
the daemon throws a MySQL error as expected, so I know it's aware of the
hosts table, it's just not querying it. A dump of the database shows
identical column values for the encoded MAC address in the lease4 and hosts
tables (although I can send that along, too, if it helps).

If I revert back to the 1.0.0 release version, reservations work fine, but
the config parser gags on the 'exists' keyword in the client-classes
section, which limits my ability to chainload iPXE, since it doesn't
support the 'exists' test keyword. I'm reluctant to go back to 1.0.0
regardless, though, since there were also some weird interactions between
it and the latest build of iPXE, which was regularly (but not always)
rejecting DHCPOFFER packets from Kea because it thought they were
non-local; the 1.0.0-git version doesn't have this problem. Manually adding
a reservation to the configuration file works as expected under both
versions, but that's the opposite direction of where I want to go with what
I'm designing.

I switched on the query logging on the MySQL daemon and the traffic pattern
is indeed different when I toggle between versions; 1.0.0-git doesn't
generate any queries like this, but 1.0.0 does:

-- cut --
Execute   SELECT host_id, dhcp_identifier, dhcp_identifier_type,
dhcp4_subnet_id, dhcp6_subnet_id, ipv4_address, hostname,
dhcp4_client_classes, dhcp6_client_classes FROM hosts WHERE dhcp4_subnet_id
= 2 AND dhcp_identifier_type = 0    AND dhcp_identifier = '^L<C4>z'
-- cut --

I tried a couple of things, like tweaking the query, but I suspect the
underlying issue is a bit deeper than that, and my C++-fu is weak. :/

Any guidance or advice would be greatly appreciated!

thanks,
Klaus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20160529/b3661038/attachment.htm>


More information about the Kea-users mailing list