D
D
DeeZ2016-06-09 15:34:45
LDAP
DeeZ, 2016-06-09 15:34:45

How to store DHCP config for ipv6 in LDAP (example)?

I'm trying to store DHCP configs in LDAP. But I can’t figure out how to enter the subnet6 parameter in LDAP. Take for example a config from the Internet:

default-lease-time 2592000;
preferred-lifetime 604800;
option dhcp-renewal-time 3600;
option dhcp-rebinding-time 7200;
allow leasequery;
option dhcp6.name-servers 3ffe:501:ffff:100:200:ff:fe00:3f3e;
option dhcp6.domain-search "test.example.com","example.com";
option dhcp6.info-refresh-time 21600;
dhcpv6-lease-file-name "/usr/local/var/db/dhcpd6.leases";
subnet6 3ffe:501:ffff:100::/64 {
  range6 3ffe:501:ffff:100::10 3ffe:501:ffff:100::11;
  range6 3ffe:501:ffff:100:: temporary;
  prefix6 3ffe:501:ffff:100:: 3ffe:501:ffff:111:: /64;
}
host myclient {
  host-identifier option
    dhcp6.client-id 00:01:00:01:00:04:93:e0:00:00:00:00:a2:a2;
  fixed-address6 3ffe:501:ffff:100::1234;
  fixed-prefix6 3ffe:501:ffff:101::/64;
  option dhcp6.name-servers 3ffe:501:ffff:100:200:ff:fe00:4f4e;
}
host otherclient {
        hardware ethernet 01:00:80:a2:55:67:34;
        fixed-address6 3ffe:501:ffff:100:4321;
}

It turns out something like this:
#dhcp сервер
dn: cn=dhcp1.v6.domain.ru,dc=domain,dc=ru
objectClass: top
objectClass: dhcpServer
cn: dhcp1.v6.domain.ru
dhcpServiceDN: cn=DHCP Service Config, dc=ipv6,dc=domain,dc=ru

#новый инстанс для конфига:
dn: dc=ipv6,dc=domain,dc=ru
dc: ipv6
o: domain.ru
objectClass: top
objectClass: dcObject
objectClass: organization

# корень конфига:
dn: cn=DHCP Service Config, dc=ipv6,dc=domain,dc=ru
cn: DHCP Service Config
objectClass: top
objectClass: dhcpService
dhcpPrimaryDN: dc=ipv6,dc=domain,dc=ru
dhcpStatements: default-lease-time 2592000;
dhcpStatements: preferred-lifetime 604800;
dhcpStatements: option dhcp-renewal-time 3600;
dhcpStatements: allow leasequery;
dhcpStatements: dhcpv6-lease-file-name "/usr/local/var/db/dhcpd6.leases";
dhcpOption: dhcp-rebinding-time 7200;
dhcpOption: dhcp6.name-servers 3ffe:501:ffff:100:200:ff:fe00:3f3e;
dhcpOption: dhcp6.domain-search "test.example.com","example.com";
dhcpOption: dhcp6.info-refresh-time 21600;

How to start subnet6 now? I believe that there is no support for subnet6 as such, but it needs to be done somehow by analogy with other unsupported parameters (via dhcpStatements). But how?

Is there anyone who has already implemented this bundle? can you show the ldif file with grids and 1-2 hosts?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DeeZ, 2016-06-14
@DeeZ

I will answer myself. There is a mistake in the official repo. On 4.2.4 it didn't work at all. did not understand.
For ISC-DHCP 4.3.4b1, you need to roll this patch:

--- ./dhcp-4.3.4b1/server/ldap.c        2016-03-05 01:40:31.000000000 +0500
+++ ./dhcp-4.3.4bf/server/ldap.c        2016-06-14 16:40:23.000000000 +0500
@@ -702,9 +702,9 @@
   struct berval **tempbv;
   int i;
 
-  x_parser_strcat (cfile, "pool {\n");
+  x_parser_strcat (cfile, "pool6 {\n");
 
-  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpRange")) != NULL)
+  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpRange6")) != NULL)
     {
       x_parser_strcat (cfile, "range6");
       for (i=0; tempbv[i] != NULL; i++)

after that everything works great.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question