Configuring SNMPv1 or SNMPv2c basic parameters

SNMPv1 and SNMPv2c settings are not supported in FIPS mode.

Only users with the network-admin or level-15 user role can create SNMPv1 or SNMPv2c communities, users, or groups. Users with other user roles cannot create SNMPv1 or SNMPv2c communities, users, or groups even if these roles are granted access to related commands or commands of the SNMPv1 or SNMPv2c feature.

To configure SNMPv1 or SNMPv2c basic parameters:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. (Optional.) Enable the SNMP agent.

snmp-agent

By default, the SNMP agent is disabled.

The SNMP agent is enabled when you use any command that begins with snmp-agent except for the snmp-agent calculate-password command.

3. (Optional.) Configure the system contact.

snmp-agent sys-info contact sys-contact

By default, the system contact is not configured.

4. (Optional.) Configure the system location.

snmp-agent sys-info location sys-location

By default, the system location is not configured.

5. Enable SNMPv1 or SNMPv2c.

snmp-agent sys-info version { all | { v1 | v2c } *}

By default, SNMPv3 is enabled.

6. (Optional.) Set a local engine ID.

snmp-agent local-engineid engineid

By default, the local engine ID is the company ID plus the device ID. The device ID varies by device model.

7. (Optional.) Set an engine ID for a remote SNMP entity.

snmp-agent remote { ipv4-address | ipv6 ipv6-address } [ vpn-instance vpn-instance-name ] engineid engineid

By default, no remote entity engine IDs exist.

This step is required for the device to send SNMPv1 or SNMPv2c notifications to a host, typically NMS.

8. (Optional.) Create or update a MIB view.

snmp-agent mib-view { excluded | included } view-name oid-tree [ mask mask-value ]

By default, the MIB view ViewDefault is predefined. In this view, all the MIB objects in the iso subtree but the snmpUsmMIB, snmpVacmMIB, and snmpModules.18 subtrees are accessible.

Each view-name oid-tree pair represents a view record. If you specify the same record with different MIB sub-tree masks multiple times, the most recent configuration takes effect. Except for the four sub-trees in the default MIB view, you can create up to 16 unique MIB view records.

9. Configure the SNMP access right.

  • (Method 1.) Create an SNMP community:
    In VACM mode:snmp-agent community { read | write } [ simple | cipher ] community-name [ mib-view view-name ] [ acl { ipv4-acl-number | name ipv4-acl-name } | acl ipv6 { ipv6-acl-number | name ipv6-acl-name } ] *
    In RBAC mode:snmp-agent community [ simple | cipher ] community-name user-role role-name [ acl { ipv4-acl-number | name ipv4-acl-name } | acl ipv6 { ipv6-acl-number | name ipv6-acl-name } ] *

  • (Method 2.) Create an SNMPv1/v2c group, and add users to the group:

    1. snmp-agent group { v1 | v2c } group-name [ read-view view-name ] [ write-view view-name ] [ notify-view view-name ] [ acl { ipv4-acl-number | name ipv4-acl-name } | acl ipv6 { ipv6-acl-number | name ipv6-acl-name } ] *

    2. snmp-agent usm-user { v1 | v2c } user-name group-name [ acl { ipv4-acl-number | name ipv4-acl-name } | acl ipv6 { ipv6-acl-number | name ipv6-acl-name } ] *

By default, no SNMP group or SNMP community exists.

The username in method 2 has the same purpose as the community name in method 1. Whichever method you use, make sure the configured name is the same as the community name on the NMS.

10. (Optional.) Create an SNMP context.

snmp-agent context context-name

By default, no SNMP contexts exist.

11. (Optional.) Map an SNMP community to an SNMP context.

snmp-agent community-map community-name context context-name

By default, no mapping exists between an SNMP community and an SNMP context.

12. (Optional.) Configure the maximum SNMP packet size (in bytes) that the SNMP agent can handle.

snmp-agent packet max-size byte-count

By default, an SNMP agent can process SNMP packets with a maximum size of 1500 bytes,

13. Specify the UDP port for receiving SNMP packets.

snmp-agent port port-num

By default, the device uses UDP port 161 for receiving SNMP packets.

14. (Optional.) Configure SNMP agent alive notification sending and set the sending interval.

snmp-agent trap periodical-interval interval

By default, sending SNMP agent alive notifications is enabled and the sending interval is 60 seconds.