snmpasn.1mib

Which characters are allowed in an SNMP OID?


I'm writing a custom MIB file and was wondering which characters I can use in textual object identifiers (OIDs), ie. in the strings that make up identifiers like iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifIndex.

It looks like only alphanumeric characters and hyphens are allowed. Also, two consecutive hyphens are forbidden as well (because they start a comment in a MIB file). But what are the exact rules, and where is that stated in the standard(s)?


Solution

  • The RFC documents for SMI contain clear descriptions on such entities, like

    For the purposes of this specification, an ASN.1 module name begins with an upper-case letter and continues with zero or more letters, digits, or hyphens, except that a hyphen can not be the last character, nor can there be two consecutive hyphens.

    Reference