4.2 Troubleshoot SNMP v2c and v3

ENARSI 300-410 v1.1 · 4.0 Infrastructure Services

SNMP lets a manager read (and sometimes change) a device's counters and settings, and lets the device send traps or informs. v2c uses a community string sent in clear; v3 adds users with authentication and privacy (encryption) through groups and views. Troubleshooting is about matching security levels, ACLs and engine IDs.

What you must know

v2c and v3 side by side

v2cv3
IdentityCommunity stringUser in a group
AuthenticationNone (the string is in clear)HMAC-SHA or MD5 (auth)
EncryptionNoneAES or DES (priv)
Access controlRO/RW + ACLGroup with read/write/notify views + ACL
Security levels–noAuthNoPriv, authNoPriv, authPriv
! v2c
snmp-server community N3tR0 RO 20
access-list 20 permit 10.0.99.20
snmp-server host 10.0.99.20 version 2c N3tR0
!
! v3
snmp-server view ALL iso included
snmp-server group NETOPS v3 priv read ALL access 20
snmp-server user nms NETOPS v3 auth sha AuthPass1 priv aes 128 PrivPass1
snmp-server host 10.0.99.20 version 3 priv nms
snmp-server enable traps snmp linkdown linkup

Polling and traps

nms$ snmpget -v3 -l authPriv -u nms -a SHA -A AuthPass1 -x AES -X PrivPass1 10.0.99.1 sysUpTime.0
SNMPv2-MIB::sysUpTime.0 = Timeticks: (1840211) 5:06:42.11

nms$ snmpget -v3 -l authNoPriv -u nms -a SHA -A AuthPass1 10.0.99.1 sysUpTime.0
Error in packet
Reason: authorizationError (access denied to that object)

Polling at the right level works (1); traps go to UDP 162 (2). Traps are fire-and-forget; informs (snmp-server host … informs) are acknowledged and resent, so they survive a lost packet.

Troubleshooting order

  1. Can the manager reach the agent on UDP 161? Check ACLs on the path.
  2. Does the community or user ACL permit the manager's source address? (show snmp community, the group's access)
  3. Does the security level match the group (noauth, auth, priv)?
  4. Do the auth and priv algorithms and keys match?
  5. Does the view include the object asked for?
  6. For traps: snmp-server enable traps … and a host line, and the trap source interface the NMS expects.

Commands

show snmpPacket counters, including bad community names and unknown users.
show snmp communityCommunities and their ACLs.
show snmp user / show snmp groupv3 users, groups, levels and views.
show snmp hostTrap and inform destinations.
debug snmp packetsEach request and reply.

Exam traps

Check yourself

Which v3 security level authenticates and encrypts?
authPriv.
Difference between a trap and an inform?
An inform is acknowledged by the manager and resent if lost; a trap is not.
You add a v3 user, then look for it in show run. Why isn't it there?
v3 users are stored in the SNMP engine, not the configuration; use show snmp user.
The NMS gets authorizationError. Two causes?
The request's security level is lower than the group's, or the view does not include the object.

Labs

Try it live: SNMP: a community the ACL refuses, then SNMPv3 with authPriv

More topics in 4.0 Infrastructure Services