[Kea-users] Cisco Nexus 3048 error
Olivier Français
olivier.francais at corp.ovh.com
Wed May 17 15:44:28 UTC 2017
Hi,
I use PostgreSQL for the database. Also, I've add a pool of ip in the
subnet in case of wrong reservation. Kea doesn't respond to the cisco
nexus, but it works for other devices.
...
{
"subnet":"10.106.0.0/23",
"next-server":"10.15.25.76",
"id":82,
"pools":[
{
"pool":"10.106.1.50 - 10.106.1.55"
}
],
"option-data":[
{
"data":"10.106.1.254",
"csv-format":true,
"name":"routers",
"space":"dhcp4",
"code":3
}
]
},
...
select * from hosts where host_id = 289;
-[ RECORD 1 ]---------+---------------
host_id | 289
dhcp_identifier | \x00a2eec66281
dhcp_identifier_type | 0
dhcp4_subnet_id | 82
dhcp6_subnet_id |
ipv4_address | 174719066
hostname | sw-818103-n3
dhcp4_client_classes |
dhcp6_client_classes |
dhcp4_next_server |
dhcp4_server_hostname | sw-818103-n3
dhcp4_boot_file_name |
--
Olivier Français
OVH SOC phy
olivier.francais at corp.ovh.com
On lun., 2017-05-15 at 12:16 +0200, Marcin Siodelski wrote:
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20170517/48ceeaaa/attachment.bin>
More information about the Kea-users
mailing list