解决ldap存mac地址的问题
http://sk363.i.sohu.com/blog/view/131311463.htm
ldapadd issue
[root@centos5 soft]# ldapadd -x -D "cn=Manager,dc=zq,dc=com" -w secret -f ytang.ldif
adding new entry "uid=ytang,ou=users,ou=sigma,dc=zq,dc=com"
ldapadd: Object class violation (65)
additional info: attribute 'macAddress' not allowed
解决办法:
- 查找macAddress 对应的objectclass
[root@centos5 schema]# grep -r macAddress *
nis.schema:attributetype ( 1.3.6.1.1.1.1.22 NAME 'macAddress'
nis.schema: MAY macAddress )
nis.schema.default:attributetype ( 1.3.6.1.1.1.1.22 NAME 'macAddress'
nis.schema.default: MAY macAddress )
在nis.schema中找到:
objectclass ( 1.3.6.1.1.1.2.11 NAME 'ieee802Device' SUP top AUXILIARY
DESC 'A device with a MAC address'
MAY macAddress )
因此,macAddress 的objectclass 是ieee802Device - 在ldif 文件中增加objectclass ieee802Device
[root@centos5 soft]# cat ytang.ldif
#ytang
dn: uid=ytang,ou=users,ou=sigma,dc=zq,dc=com
objectclass: top
objectclass: person
objectclass: inetorgperson
objectclass: radiusprofile
objectclass: ipHost
objectclass: ieee802Device
cn: ytang
sn: ytang
#radiusTunnelType: 10
#radiusTunnelType: 13
#radiusTunnelPrivateGroupId: 3000
#radiusTunnelMediumType: 1
uid: ytang
userPassword: ytang
ipHostNumber: 192.168.1.10
macAddress: 11:22:33:44:55:66