Friday, December 22, 2006

LDAP Partition

Parent LDAP server: ldap://tp.example.com:389/

dn: dc=example, dc=com
dc: example
objectclass: dcObject
objectclass: organizationalUnit
ou: example com

dn: ou=tp, dc=example, dc=com
objectclass: organizationalUnit
ou: tp

dn: ou=people, ou=tp, dc=example, dc=com
objectclass: organizationalUnit
ou: people

dn: ou=group, ou=tp, dc=example, dc=com
objectclass: organizationalUnit
ou: group

dn: cn=kevin, ou=group, ou=tp, dc=example, dc=com
....

dn: ou=ks, dc=example, dc=com
objectClass: referral
objectClass: extensibleobject
ou: ks
ref: ldap://ks.example.com/ou=ks,dc=example,dc=com


Child LDAP server: ldap://ks.example.com:389/

/etc/openldap/slapd.conf
referral ldap://tp.example.com:389/

dn: ou=ks, dc=example, dc=com
objectclass: organizationalUnit
ou: ks

dn: ou=people, ou=ks, dc=example, dc=com
objectclass: organizationalUnit
ou: people

dn: ou=group, ou=ks, dc=example, dc=com
objectclass: organizationalUnit
ou: group

dn: cn=david, ou=group, ou=ks, dc=example, dc=com

Query by ldapsearch:
Must add parameter -C to search for referrals

From parent (tp.example.com):
ldapsearch -x -C -b "dc=example,dc=com" "cn=david"

From child (ks.example.com):
ldapsearch -x -C -b "dc=example,dc=com" "cn=kevin"

No comments: