2

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

谢谢-拉维

4

3 回答 3

2

基于社区的模型还引用了 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))

在您通过 CLI 设置此选项时,在 Cisco 交换机/路由器上似乎也已强制执行。

于 2017-02-09T01:48:08.370 回答
1

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

于 2017-01-30T14:38:55.793 回答
0

Cisco 路由器上的 SNMP 版本 2c 最大社区长度为 128 个字符。

于 2022-03-03T19:13:18.393 回答