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
- Configure SNMPv2c communities with ACLs, and trap hosts.
- Configure SNMPv3 groups, users, views and the three security levels.
- Know traps versus informs.
- Find why a manager gets no reply: community, ACL, security level, key, view.
v2c and v3 side by side
| v2c | v3 | |
|---|---|---|
| Identity | Community string | User in a group |
| Authentication | None (the string is in clear) | HMAC-SHA or MD5 (auth) |
| Encryption | None | AES or DES (priv) |
| Access control | RO/RW + ACL | Group 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 linkupPolling 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
- Can the manager reach the agent on UDP 161? Check ACLs on the path.
- Does the community or user ACL permit the manager's source address? (
show snmp community, the group'saccess) - Does the security level match the group (
noauth,auth,priv)? - Do the auth and priv algorithms and keys match?
- Does the view include the object asked for?
- For traps:
snmp-server enable traps …and ahostline, and the trap source interface the NMS expects.
Commands
show snmp | Packet counters, including bad community names and unknown users. |
show snmp community | Communities and their ACLs. |
show snmp user / show snmp group | v3 users, groups, levels and views. |
show snmp host | Trap and inform destinations. |
debug snmp packets | Each request and reply. |
Exam traps
- v3 users are not in the running configuration.
- A group at
privrefusesauthNoPrivrequests. - Changing the engine ID invalidates every v3 user's localized keys.
- Without
snmp-server enable traps, ahostline sends nothing. - v2c RW with no ACL lets anyone who sniffs the string change the device.
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
- 4.4 Troubleshoot DHCP for IPv4 and IPv6: clients, the IOS server, relay and options
- 4.5 Troubleshoot network performance with IP SLA: jitter, delay, reachability and tracking
- 4.6 Troubleshoot NetFlow v9, Flexible NetFlow and IPFIX
- 4.7 Troubleshoot with Catalyst Center Assurance: connectivity, device and network health