Configuring SNMP

The SNMP agent provides read-only access in this release.
  1. Enable the SNMP agent on either the management interface, or the switch data ports, with the commandsnmp-server vrf. For example, use the command snmp-server vrf mgmt to enable SNMP on the management interface. Use the command snmp-server vrf default to enable SNMP on the default vrf which is initially assigned to all data ports.
  2. Set the system contact, location, and description for the switch with the following commands:
    • snmp-server system-contact

    • snmp-server system-location

    • snmp-server system-description

  3. If required, change the default SNMP port on which the agent listens for requests with the command snmp-server agent-port.
  4. By default, the agent uses the community string public to protect access through SNMPv1/v2c. Set a new community string with the command snmp-server community.
  5. Configure the trap receivers to which the SNMP agent will send trap notifications with the command snmp-server host.
  6. To support SNMP v3 users, define one or more SNMPv3 contexts with the command snmpv3 context, then define credentials for one or more users with the command snmpv3 user. Finally, associate defined users with an SNMPv3 context with the command snmpv3 user context.
  7. Review your SNMP configuration settings with the following commands:
    NOTE: Configuring snmpv3 informs is not supported.
    • show snmp agent-port

    • show snmp community

    • show snmp system

    • show snmpv3 context

    • show snmp trap

    • show snmp vrf

    • show snmpv3 users

    • show tech snmp

Example 1

This example creates the following configuration:

  • Enables SNMP on the out-of-band management interface (VRF mgmt).
  • Sets the contact, location, and description for the switch to: JaniceM, Building2, LabSwitch.
  • Sets the community string to Lab8899X.
switch(config)# snmp-server vrf mgmt
switch(config)# snmp-server system-contact JaniceM
switch(config)# snmp-server system-location Building2
switch(config)# snmp-server system-description LabSwitch 
switch(config)# snmp-server community Lab8899X
Example 2

This example creates the following configuration:

  • Creates an SNMPv3 user named Admin using sha authentication with the plaintext password mypassword and using des security with the plaintext password myprivpass.
  • Associates the SNMPv3 user Admin with a context named newContext.
switch(config)# snmpv3 user Admin auth sha auth-pass plaintext mypassword priv des priv-pass plaintext myprivpass
switch(config)# snmpv3 user Admin context newContext