This scenario shows how to create a user in SNMPv3 by manually editing the /etc/snmpdv3.conf and /etc/clsnmp.conf files.
User u1 will be created in this scenario. User u1 will be given authorization keys, but will not be given privacy keys (which are available only if you have the snmp.crypto fileset installed). The HMAC-MD5 protocol will be used to create u1's authorization keys. After u1 is configured, it will be put into a group, after which that group will have its view and access permissions defined. Finally, trap entries for u1 will be created.
Each individual value used in the /etc/snmpdv3.conf and /etc/clsnmp.conf files must not exceed 32 bytes.
pwtokey -p HMAC-MD5 -u auth anypassword 9.3.230.119The IP address specified is the IP address where the agent is running.
The password can by any password, but be sure to save it in a secure place
for future use. The output should look similar to the following:
Display of 16 byte HMAC-MD5 authKey:
63960c12520dc8829d27f7fbaf5a0470
Display of 16 byte HMAC-MD5 localized authKey:
b3b6c6306d67e9c6f8e7e664a47ef9a0 #--------------------------------------------------------------------------- # USM_USER entries # Defines a user for the User-based Security Model (USM). # Format is: # userName engineID authProto authKey privProto privKey keyType storageType # USM_USER u1 - HMAC-MD5 b3b6c6306d67e9c6f8e7e664a47ef9a0 - - L - #----------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------- # # Format of entries: # winSnmpName targetAgent admin secName password context secLevel authProto authKey privProto privKey # user1 9.3.230.119 SNMPv3 u1 - - AuthNoPriv HMAC-MD5 63960c12520dc8829d27f7fbaf5a0470 - - #----------------------------------------------------------------------------------------------------
The user must now be placed in a group. If you already have a group that is configured with all of the view and access permissions that you want to give this user, you can put this user in that group. If you want to give this user view and access permissions that no other groups have, or if you do not have any groups configured, create a group and add this user to it.
To add the user to a new group, create a new VACM_GROUP entry in the /etc/snmpdv3.conf file. The group entry for u1 follows:
#-------------------------------------------------------------- # VACM_GROUP entries # Defines a security group (made up of users or communities) # for the View-based Access Control Model (VACM). # Format is: # groupName securityModel securityName storageType VACM_GROUP group1 USM u1 - #--------------------------------------------------------------
The view and access permissions must be set for the new group that was just created. These permissions are set by adding VACM_VIEW and VACM_ACCESS entries to the /etc/snmpdv3.conf file.
#---------------------------------------------------------------- # VACM_VIEW entries # Defines a particular set of MIB data, called a view, for the # View-based Access Control Model. # Format is: # viewName viewSubtree viewMask viewType storageType VACM_VIEW group1View interfaces - included - VACM_VIEW group1View tcp - included - VACM_VIEW group1View icmp - included - VACM_VIEW group1View system - included - VACM_VIEW group1View sysObjectID - excluded - #----------------------------------------------------------------
#----------------------------------------------------------------------------------------------------------- # VACM_ACCESS entries # Identifies the access permitted to different security groups # for the View-based Access Control Model. # Format is: # groupName contextPrefix contextMatch securityLevel securityModel readView writeView notifyView storageType VACM_ACCESS group1 - - AuthNoPriv USM group1View - group1View - #-----------------------------------------------------------------------------------------------------------
Trap entries in SNMPv3 are created by adding NOTIFY, TARGET_ADDRESS and TARGET_PARAMETERS entries to the /etc/snmpdv3.conf file. The TARGET_ADDRESS entry will specify where you want the traps to be sent, and the TARGET_PARAMETERS entry will map the TARGET_ADDRESS information to group1.
The NOTIFY entry has been configured by default. Following is the default NOTIFY entry:
NOTIFY notify1 traptag trap -
In this scenario, we use the value that is specified in the default entry, traptag.
#------------------------------------------------------------------------------------- # TARGET_ADDRESS # Defines a management application's address and parameters # to be used in sending notifications. # Format is: # targetAddrName tDomain tAddress tagList targetParams timeout retryCount storageType #------------------------------------------------------------------------------------- TARGET_ADDRESS Target1 UDP 9.3.207.107 traptag trapparms1 - - -
#------------------------------------------------------------------------- # TARGET_PARAMETERS # Defines the message processing and security parameters # to be used in sending notifications to a particular management target. # Format is: # paramsName mpModel securityModel securityName securityLevel storageType #------------------------------------------------------------------------- TARGET_PARAMETERS trapparms1 SNMPv3 USM u1 AuthNoPriv
After making the changes the /etc/snmpdv3.conf file, stop and the start the snmpd daemon.
stopsrc -s snmpd
startsrc -s snmpd
The new settings will now take effect.
To verify that your configuration is correct, you can run the following command on the SNMP manager .
clsnmp -h user1 walk mibwhere mib is a MIB subtree to which the user has access. In this scenario, it could be interfaces, tcp, icmp, or system. If the configuration is correct, you will see the information from the specified subtree.
If you did not get the correct output, review the steps in this document and verify that you have entered all information correctly.