Three SNMP versions are available: v1, v2c, and v3. SNMPv1 and SNMPv2c support community names, but SNMPv3 does not support.
Run the snmp-agent community { read | write } { community-name | cipher community-name } [ aliasalias-name ] command in the system view to set the SNMP community name.
NOTE:
The alias alias-name parameter is only supported in V100R003C00 and later versions. To facilitate identification of community names, set alias for community names. The alias are stored in the configuration file as plain text.
Note the following points when configuring SNMP community names:
-
By default, the system checks the community name complexity. The community name that fails the check is not allowed.
The community name must meet the following requirements:
- The community name contains at least eight characters.
- The community name must be a combination of at least two of uppercase letters A to Z, lowercase letters a to z, digits, and special characters (excluding question masks and spaces). If the character string is quoted by double quotation marks, the character string can contain spaces.
To ensure SNMP community name security, do not disable community name complexity check by running the snmp-agent community complexity-check disable command.
If you set different rights (
read or
write) for the same community name, the last configuration takes effect.
For example, set the read/write community name for SNMPv2c to Private123.
<HUAWEI> system-view
[~HUAWEI] snmp-agent sys-info version v2c //Configure the SNMP version as SNMPv2c
[*HUAWEI] snmp-agent community write Private123 //Configure the read-write community name as Private123
[*HUAWEI] commit