Configuring SNMP

The SNMP agent provides read-only access in this release.
Procedure
  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 commands snmp-server system-contact, snmp-server system-description, and snmp-server system-location.
  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 commands show snmp agent-port, show snmp community, show snmp system, show snmpv3 context, show snmp trap, show snmp vrf, and show snmpv3 users.

Example

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