# DHCP LDAP BACKEND

## pttang

Anyone been able to get a ldap patched dhcp server up and running?

----------

## l0ner

I managed to get the isc dhcp to compile with the ldap patch.

I edited the ebuild so that the patch was used, and I added -lldap -llber to the lib infos in the make conf.

I'm currently setting up my ldap, so when it is done, I'll let you know what I found out.

I used this patch : http://www.lunytune.net/dhcp-3.0pl2.ldap.diff.gz

and I copied the r6 ebuild to r9 and made the following changes (diff output):

```

--- /usr/portage/net-misc/dhcp/dhcp-3.0_p2-r6.ebuild    2004-07-18 06:07:20.000000000 +0000

+++ /usr/portage/net-misc/dhcp/dhcp-3.0_p2-r9.ebuild    2004-08-23 22:34:26.000000000 +0000

@@ -2,7 +2,7 @@

 # Distributed under the terms of the GNU General Public License v2

 # $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-3.0_p2-r6.ebuild,v 1.5 2004/07/18 06:02:28 vapier Exp $

-IUSE="static selinux"

+IUSE="static selinux ldap"

 inherit eutils flag-o-matic

@@ -30,6 +30,7 @@

        epatch "${FILESDIR}/dhclient.c-3.0-dw-cli-fix.patch"

        epatch "${FILESDIR}/dhcp-3.0+paranoia.patch"

        epatch "${FILESDIR}/dhcp-3.0pl2-fix-perms.patch"

+       epatch "${FILESDIR}/dhcp-3.0pl2.ldap.patch"

 }

 src_compile() {

@@ -51,6 +52,7 @@

        END

        cat <<-END > site.conf

+       LIBS = -lldap -llber

        CC = gcc

        LIBDIR = /usr/lib

        INCDIR = /usr/include

```

this however is not a propely done ebuild

BTW, after downloading the patch you need to move it to :

/usr/portage/net-misc/dhcp/files/

and run:

ebuild dhcp-3.0_p2-r9.ebuild digest

----------

## epretorious

This sounds interesting. What's the purpose of combining DHCP & LDAP?    :Question: 

----------

## RedDawn

*BUMP* im enterested in this too.. what is the purpose?

----------

## l0ner

You should then be able to administer the dhcp information from ldap.

This offers the following things:

a) If an address is manually assigned, you can do it through ldap.

This means that you have the IP & MAC infos available for all network devices in your ldap directory. Which is excellent for reference purposes.

b) If you use dynamic ranged based assignments, then the assignments are made in ldap. So if your dns also uses ldap, you can update the dns for the dhcp hosts automatically.

c) If you use netboot pc's (or other netboot clients) you can administer the booting dhcp infos through ldap instead of using the text files.

I am sure that a longer list could be made, but these two are the main reasons.

----------

## RedDawn

Nice..  :Very Happy:    Thanks man!

----------

## fisch09

 *l0ner wrote:*   

> You should then be able to administer the dhcp information from ldap.
> 
> This offers the following things:
> 
> a) If an address is manually assigned, you can do it through ldap.
> ...

 

would you post an example ldap-entry for c) please?

thnx fisch

----------

## BigBeer

This thread is old, but I just decided to fire up dhcp with ldap.

The patch location for the newest version of isc dhcp is : http://www.newwave.net/~masneyb/

I've got this stuff going and coded my frontend to make entires in ldap just fine and dandy, but my question

goes out to all the ldap dhcp people....

Does this stuff store the lease info in the ldap database??

I see a nice objectclass called dhcpLeasesDN in the schema, but I am unable to find any records for any leases,

and my dhcp server still has a dhcpd.leases file.

Just wondering if anyone knows if/how to get dhcp to store the lease info in ldap.

--

BigBeer

----------

## zuki

Hi here is the patch for the current dhcp-3.1.0:

```

18c18

< IUSE="doc minimal static selinux kernel_linux ldap"

---

> IUSE="doc minimal static selinux kernel_linux"

21d20

<    ldap?      ( net-nds/openldap )

57,58d55

<    # This allows to store configuration in ldap 

<    epatch "${FILESDIR}/${PN}"-3.1.0-ldap.patch

127d123

<    LIBS = -lldap -llber

```

get the ldap patch from:

http://linex.educarex.es/dhcpd-ldap/dhcp-3.1.0-ldap.patch

after patching run:

```

ebuild /usr/local/portage/net-misc/dhcp/dhcp-3.1.0.ebuild digest

```

The build runs fine, but I did not test the function....

greetz

----------

## zuki

Hi,

to manage your dhcp-ldap entries you can use "unattended-gui.sf.net". It is possible to use this system also as a stand alone font end for DHCP-LDAP.

See some screen shots:

http://unattended-gui.sourceforge.net/index.php?title=Screenshots:dhcp_ldap

For any question use the sf.net mailing lists.

greetz mario

----------

## czytom

 *zuki wrote:*   

> Hi here is the patch for the current dhcp-3.1.0:
> 
> ```
> 
> 18c18
> ...

 

Have you added this patch to bugs.gentoo.org? It will be nice to merge it into official ebuild.

----------

## olli.bo

Hi,

is there a patch for dhcp-3.1.1?

Why isn't the ldap patch in the default portage ebuild?

----------

