SNMPv2c的读写社区允许的最大长度

时间:2017-01-30 07:48:31

标签: snmp net-snmp webnms

请告诉我SNMPv2c读写社区允许的最大长度。我没有找到任何可以提供相同描述的相关文档。

由于 -Ravi

2 个答案:

答案 0 :(得分:1)

根据RFC 3584,长度没有明确的限制。 限制将是实用的(消息大小等)。

答案 1 :(得分:0)

基于社区的模型还引用了USM表中的条目。遵循RFC3414中定义的SNMP USM MIB,usmUserName和usmSecurityName的定义如下所示,将用户名限制为32个字符。文本约定SnmpAdminString本身是255个八位字节长

usmUserName      OBJECT-TYPE
    SYNTAX       SnmpAdminString (SIZE(1..32))
    MAX-ACCESS   not-accessible
    STATUS       current
    DESCRIPTION "A human readable string representing the name of
                 the user.

                 This is the (User-based Security) Model dependent
                 security ID.
                "
    ::= { usmUserEntry 2 }

usmUserSecurityName OBJECT-TYPE
    SYNTAX       SnmpAdminString
    MAX-ACCESS   read-only
    STATUS       current
    DESCRIPTION "A human readable string representing the user in
                 Security Model independent format.

                 The default transformation of the User-based Security
                 Model dependent security ID to the securityName and
                 vice versa is the identity function so that the
                 securityName is the same as the userName.
                "
    ::= { usmUserEntry 3 }

文本约定usmUserSecurityName在RFC3411中定义

SnmpAdminString ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "255t"
    STATUS       current
    DESCRIPTION "An octet string containing administrative
                 information, preferably in human-readable form.

...

                 Note that when this TC is used for an object that
                 is used or envisioned to be used as an index, then
                 a SIZE restriction MUST be specified so that the
                 number of sub-identifiers for any object instance
                 does not exceed the limit of 128, as defined by
                 [RFC3416].

                 Note that the size of an SnmpAdminString object is
                 measured in octets, not characters.
                "
    SYNTAX       OCTET STRING (SIZE (0..255))

在Cisco交换机/路由器上,当您通过CLI设置时,它似乎也会强制执行。