You try to modify a Object in the context dc=internal,dc=domain,dc=com.
This is the second step. You need to modify the Schema Configuration first.
The post you already found describe it. Look at the dn in the ldapmod dn: cn={N}test,cn=schema,cn=config
By the way it is not a good idea to modify an existing schema. You should add you own.
this will make a string 'myattribute' (SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
dn: cn=myschema,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: myschema
olcAttributeTypes: {0}( 1.1.3.5.1 NAME 'myattribute' DESC 'description of myattribute' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcObjectClasses: {0}( 1.1.3.7.1 NAME 'myObjectClass' DESC 'description of myObjectClass' SUP top AUXILIARY MAY ( myattribute ) )
after adding the schema to cn=config you can add the attribute like so:
dn: dc=internal,dc=domain,dc=com
changetype: modify
add: ObjectClass
ObjectClass: myObjectClass
-
add: myattribute
myattribute: value1
myattribute: value2
The OID's 1.1.3.5.1 and 1.1.3.7.1 in this example are from a 'dead OID area' you my want to register a Private Enterprise Number: https://pen.iana.org/pen/PenApplication.page