Only v3 supports the configuration of user group and user name. By default, SNMPv3 is enabled on a device.
The security level of a user cannot be lower than the security level of the user group to which the user belongs. Security levels in the descending order are as follows:
privacy: authentication and encryption
authentication: authentication and no encryption
none: no authentication and no encryption
If a user group is at the privacy level, the users and trap hosts of the user group must be at the privacy level. If a user group is at the authentication level, the users and trap hosts of the user group must be at the privacy or authentication level.
In the versions earlier than V200R003C00:
# Set the user group name to group001 and security level to privacy, and configure access control to restrict the access of the NMS to the device.
<HUAWEI> system-view[HUAWEI] snmp-agent group v3 group001 privacy write-view alliso acl 2001
# Set the user name to user001, authentication password to Authe1234 and encryption password to Priva1234.
<HUAWEI> system-view[HUAWEI] snmp-agent usm-user v3 user001 group001 authentication-mode sha Authe1234 privacy-mode des56 Priva1234
V200R003C00 and later versions:
# Set the user group name to group001 and security level to privacy, and configure access control to restrict the access of the NMS to the device.
<HUAWEI> system-view[HUAWEI] snmp-agent group v3 group001 privacy write-view alliso acl 2001
# Set the user name to user001, authentication password to Authe@1234 and encryption password to Priva@1234.
<HUAWEI> system-view[HUAWEI] snmp-agent usm-user v3 user001 group group001[HUAWEI] snmp-agent usm-user v3 user001 authentication-mode shaPlease configure the authentication password (8-64) Enter Password: // Enter authentication password Authe@1234. Confirm Password: // Enter authentication password Authe@1234. [HUAWEI] snmp-agent usm-user v3 user001 privacy-mode aes256Please configure the privacy password (8-64) Enter Password: // Enter encryption password Priva@1234. Confirm Password: // Enter encryption password Priva@1234.