Send kea-dev mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/kea-dev
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of kea-dev digest..."
Today's Topics:
1. MySQL host reservations in Github master branch?
(Jeffery Harrell)
2. Re: MySQL host reservations in Github master branch?
(Marcin Siodelski)
----------------------------------------------------------------------
Message: 1
Date: Sun, 17 Jul 2016 12:24:11 -0700
From: Jeffery Harrell <[email protected]>
To: [email protected]
Subject: [kea-dev] MySQL host reservations in Github master branch?
Message-ID:
<CAO3jZhT4gRWtNCo3-cjttdD7CkwSC7MaSL3Vp8iF2m=e0p-...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
I feel like I?m doing something stupid, but I?ll ask anyway: Is it possible
that MySQL host reservations are currently not working in the Github master
branch?
I discovered what I think may be a very obscure bug in 1.0.0 having to do
with OFFER replies meant for VMs running on hosts on VLAN trunks (no
seriously), so I wanted to check the latest version of the project to see
if it?s already been taken care of. I set up a lab system, cloned the repo
and made a build with ?with-dhcp-mysql. I set up a new database with
dhcpdb_create.mysql from Github and inserted a host according to
https://kea.isc.org/wiki/HostReservationsHowTo.
This test server will happily serve up pool addresses (and will stash the
lease info in MySQL, so the database connection is for-sure working) but it
completely and obstinately ignores the contents of the hosts database
table. I?ve tried both same-subnet and through-a-relay clients and the
server claims to be unable to find a host for hardware address
such-and-whatever.
Here?s the relevant part of my config file:
"interfaces-config": {
"interfaces": [ "eth0" ],
"dhcp-socket-type": "raw"
},
"lease-database": {
"type": "mysql",
"name": "[REDACTED]",
"host": "[REDACTED]",
"user": "[REDACTED]",
"password": "[REDACTED]"
},
"hosts-database": {
"type": "mysql",
"name": "[REDACTED]",
"host": "[REDACTED]",
"user": "[REDACTED]",
"password": "[REDACTED]"
},
"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
},
"option-data": [
{ "name": "domain-name-servers", "data": "[REDACTED]" },
{ "name": "domain-search", "data": "[REDACTED]" }
],
"valid-lifetime": 3600,
"subnet4":
[
{
"id": [REDACTED],
"subnet": "[REDACTED]/24",
"valid-lifetime": 3600,
"option-data":
[
{ "name": "routers", "data": "[REDACTED]" }
]
}
]
And here?s the SQL statement I used to insert the host reservation:
INSERT INTO hosts (dhcp_identifier, dhcp_identifier_type,
dhcp4_subnet_id, ipv4_address, hostname) VALUES
(UNHEX(REPLACE('[REDACTED]', ':', '')), (SELECT type FROM
host_identifier_type WHERE name='hw-address'), [REDACTED],
INET_ATON('[REDACTED]'), '[REDACTED]');
Am I doing something wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://lists.isc.org/pipermail/kea-dev/attachments/20160717/52f316ea/attachment-0001.html>
------------------------------
Message: 2
Date: Mon, 18 Jul 2016 09:30:21 +0200
From: Marcin Siodelski <[email protected]>
To: Jeffery Harrell <[email protected]>
Cc: [email protected]
Subject: Re: [kea-dev] MySQL host reservations in Github master
branch?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
On 17.07.2016 21:24, Jeffery Harrell wrote:
> I feel like I?m doing something stupid, but I?ll ask anyway: Is it
> possible that MySQL host reservations are currently not working in the
> Github master branch?
>
> I discovered what I think may be a very obscure bug in 1.0.0 having to
> do with OFFER replies meant for VMs running on hosts on VLAN trunks (no
> seriously), so I wanted to check the latest version of the project to
> see if it?s already been taken care of. I set up a lab system, cloned
> the repo and made a build with ?with-dhcp-mysql. I set up a new database
> with dhcpdb_create.mysql from Github and inserted a host according to
> https://kea.isc.org/wiki/HostReservationsHowTo.
>
> This test server will happily serve up pool addresses (and will stash
> the lease info in MySQL, so the database connection is for-sure working)
> but it completely and obstinately ignores the contents of the hosts
> database table. I?ve tried both same-subnet and through-a-relay clients
> and the server claims to be unable to find a host for hardware address
> such-and-whatever.
>
> Here?s the relevant part of my config file:
>
> |"interfaces-config": { "interfaces": [ "eth0" ], "dhcp-socket-type":
> "raw" }, "lease-database": { "type": "mysql", "name": "[REDACTED]",
> "host": "[REDACTED]", "user": "[REDACTED]", "password": "[REDACTED]" },
> "hosts-database": { "type": "mysql", "name": "[REDACTED]", "host":
> "[REDACTED]", "user": "[REDACTED]", "password": "[REDACTED]" },
> "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 }, "option-data": [ { "name":
> "domain-name-servers", "data": "[REDACTED]" }, { "name":
> "domain-search", "data": "[REDACTED]" } ], "valid-lifetime": 3600,
> "subnet4": [ { "id": [REDACTED], "subnet": "[REDACTED]/24",
> "valid-lifetime": 3600, "option-data": [ { "name": "routers", "data":
> "[REDACTED]" } ] } ] |
>
> And here?s the SQL statement I used to insert the host reservation:
>
> |INSERT INTO hosts (dhcp_identifier, dhcp_identifier_type,
> dhcp4_subnet_id, ipv4_address, hostname) VALUES
> (UNHEX(REPLACE('[REDACTED]', ':', '')), (SELECT type FROM
> host_identifier_type WHERE name='hw-address'), [REDACTED],
> INET_ATON('[REDACTED]'), '[REDACTED]'); |
>
> Am I doing something wrong?
>
I don't see any obvious errors in what you're doing. But, since most of
the values are "redacted" I can't say if there are any typos in the
configuration etc.
Host reservations in MySQL should work fine on the latest github
version. If the server is unable to find the reservation for a client,
I'd think there is some configuration error. Typically, this might be a
subnet-id mismatch between the configuration and the value stored in the
database, or mismatch in the HW address between the host reservation
entry and the client contacting the server. One more thing is that the
reserved address can be hijacked by another client at the time when the
reservation didn't exist. But, if this is a simple test with only one
client, that's rather unlikely.
I am willing to assist you in further investigating this issue, but I
don't see much I could do without some additional data. Ideally it would be:
- The contents of the database, e.g. SELECT * FROM hosts;
- The subnet configuration in Kea, including subnet-id
- wireshark capture including the communication of this particular
client with the server.
- Server log on debug level.
If this is sensitive information you don't want to post to the list,
you're welcome to contact me privately.
Thanks for trying out Kea!
Marcin Siodeski
DHCP Software Engineer,
ISC
------------------------------
Subject: Digest Footer
_______________________________________________
kea-dev mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-dev
------------------------------
End of kea-dev Digest, Vol 28, Issue 7
**************************************