Please Help me about DHCP with ldap

Issues related to configuring your network
Post Reply
willy70
Posts: 8
Joined: 2017/05/03 09:54:30

Please Help me about DHCP with ldap

Post by willy70 » 2017/07/04 09:30:16

Dear All,
I would like to use CentOS 7 to manage private networks and I would like to use the dhcp package in the distribution
to assign ip addresses.

This scenario is common and known to all but my peculiarity is to use as backend ldap.

All IP addresses and mac-addresses are pre-recorded in ldap, and each client that connects to the network always
gets the same address.

All this works but has a problem. If a mac-address try to connect on two networks, then on two different ldap trees,
the dhcp client fails to control the second tree and assigns an IP different from the expected one, and then stores this
information in the dhcp.lease file.

My configuration file is this:

ldap-server "10.0.0.1";
ldap-port 389;
ldap-username "cn=XXX,dc=LOCAL";
ldap-password "PASSWORD";
ldap-base-dn "ou=dhcp,dc=priv";
ldap-method dynamic;
ldap-debug-file "/var/log/dhcp-ldap-startup.log";
#ldap-ssl off;


If the client is present in one ldap tree it all works correctly.

Any ideas ? Why dhcp can't resolve the second tree (domain) ?
Best Regards
Willy

mmirko
Posts: 1
Joined: 2017/08/02 08:21:30

Re: Please Help me about DHCP with ldap

Post by mmirko » 2017/08/02 08:48:45

Hi Willy,

I had the same problem some years ago, it is the result of how the query is done within the dhcpd ldap.c file. I wrote a patch (that I attach) for the 4.2.X isc-dhcpd series and sent it to the developers but I think it has never gone to the sources mainstream. I never tested it with other dhcpd versions but I use it on centos 7 and works perfectly.

To use it run from within the dhcpd-4.2.X/server directory:

patch -p0 < /path/to/multisegment-ldap.patch

and recompile dhcpd

Best regards
Mirko
Attachments
multisegment-ldap-patch.gz
(1.04 KiB) Downloaded 98 times

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Please Help me about DHCP with ldap

Post by TrevorH » 2017/08/03 19:08:00

To get the patch into RHEL or CentOS you would need to report it as a bug on bugzilla.redhat.com and when/if RH accept it and make it part of the package, then it will get rebuilt for CentOS.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply