[Kea-users] DNS configuration via reservations & MySQL

Stas Starikevich stas.starikevich at gmail.com
Wed Apr 19 18:47:04 UTC 2017


Hello,

I tested examples from http://kea.isc.org/wiki/HostReservationsHowTo and
found that DNS example doesn't work on FreeBSD dhclient.
Can someone from devs check my research and confirm findings?

First problem:

SET @dns_servers_option_code = 5;

should be:

SET @dns_servers_option_code = 6:

Second problem:

SET @dns_servers_option_value = UNHEX(CONCAT(HEX(INET_ATON('8.8.8.8')),
HEX(INET_ATON('8.8.4.4'))));

into the value column of 'dhcp4_options' table.

In this case lease can't be retrieved with error in DHCP server logs:

2017-04-19 14:35:34.732 DEBUG [kea-dhcp4.bad-packets/64105]
DHCP4_PACKET_DROP_0007 [hwtype=1 d4:ae:52:a7:ec:10],
cid=[01:d4:ae:52:a7:ec:10], tid=0xe9f101fd: failed to process packet:
DHCPv4 Option4AddrLst 6 has invalid length=7, must be divisible by 4.

Instead of hex value I just put both DNS IP's into the 'formatted_value'
column, separated by comma:

SET @scope_name = 'subnet';
SET @dns_servers_option_code = 6;
SET @inserted_host_id = 7;
SET @dns_servers_option_value = '8.8.8.8, 8.8.4.4';
INSERT INTO dhcp4_options (code, formatted_value, space, host_id, scope_id)
VALUES (@dns_servers_option_code,
        @dns_servers_option_value,
        'dhcp4',
@inserted_host_id,
        (SELECT scope_id FROM dhcp_option_scope WHERE scope_name =
@scope_name));

Works fine - resolvconf updates /etc/resolv.conf correctly.

And in DHCP server log:

2017-04-19 14:41:36.276 DEBUG [kea-dhcp4.packets/64105] DHCP4_PACKET_SEND
[hwtype=1 d4:ae:52:a7:ec:10], cid=[01:d4:ae:52:a7:ec:10], tid=0x6b7f38bb:
trying to send packet DHCPACK (type 5) from 10.10.10.254:67 to
10.10.10.76:68 on interface em0
2017-04-19 14:41:36.276 DEBUG [kea-dhcp4.packets/64105] DHCP4_RESPONSE_DATA
[hwtype=1 d4:ae:52:a7:ec:10], cid=[01:d4:ae:52:a7:ec:10], tid=0x6b7f38bb:
responding with packet DHCPACK (type 5), packet details: local_address=
10.10.10.254:67, remote_adress=10.10.10.76:68, msg_type=DHCPACK (5),
transid=0x6b7f38bb,
options:
  type=001, len=004: 4294967040 (uint32)
  type=003, len=004: 10.10.10.1
  type=006, len=008: 8.8.8.8 8.8.4.4
  type=012, len=016: "hostname.freebsd" (string)
  type=051, len=004: 4000 (uint32)
  type=053, len=001: 5 (uint8)
  type=054, len=004: 10.10.10.254
  type=061, len=007: 01:d4:ae:52:a7:ec:10

PXE config set via 'hosts' table, DNS and router:

root at localhost [dhcp]> select * from dhcp4_options;
+-----------+------+-------+------------------+-------+------------+-------------------+-----------------+---------+----------+
| option_id | code | value | formatted_value  | space | persistent |
dhcp_client_class | dhcp4_subnet_id | host_id | scope_id |
+-----------+------+-------+------------------+-------+------------+-------------------+-----------------+---------+----------+
|         7 |    3 | NULL  | 10.10.10.1       | dhcp4 |          0 | NULL
           |            NULL |       7 |        1 |
|        14 |    6 | NULL  | 8.8.8.8, 8.8.4.4 | dhcp4 |          0 | NULL
           |            NULL |       7 |        1 |
+-----------+------+-------+------------------+-------+------------+-------------------+-----------------+---------+----------+

Tested on FreeBSD 10.3, both server and client.



Stas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20170419/25768da4/attachment.htm>


More information about the Kea-users mailing list