[Kea-users] Cisco Nexus 3048 error

Marcin Siodelski marcin at isc.org
Mon May 15 10:16:42 UTC 2017


On 15.05.2017 10:56, Olivier Français wrote:
> Hi,
>
> Yes, we use reservation in SQL database with mac address. We also add a
> pool of IPs in the subnet.
>
>

We have recently got similar report from another Kea user and it turned
out to be the issue with a reservation for an option inserted into MySQL
database.

The way it should be done is:

SET @dns_servers_option_code = 5;
-- This option comprises one or multiple IPv4 addresses. --
-- We insert option containing two IPv4 addresses: 192.0.2.1 and --
-- 192.0.2.2 by concatenating hexadecimal representations of these --
-- addresses and then converting the result into binary format. --
SET @dns_servers_option_value =
UNHEX(CONCAT(LPAD(HEX(INET_ATON('10.0.2.1')), 8, 0),
LPAD(HEX(INET_ATON('10.0.2.2')), 8, 0)));

INSERT INTO dhcp4_options (code, 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));


You should pay attention to the use of LPAD() MySQL function which, in
this example, guarantees that each IP address (10.0.2.1 and 10.0.2.2) is
padded with a leading zeros  if needed and is exactly 8 digits long. If
you omit the LPAD() function some IP addresses will be truncated and the
overall option length will be shorter. Kea will complain that the
options are invalid.

Please give it a try and let me know if you have further issues.

Marcin Siodelski
ISC



More information about the Kea-users mailing list