Networking · IP Services
SNMP
Cheat sheet · https://pcornel.dk/topic.php?topic=665
Answer
SNMP exposes managed objects through an agent for polling and can send asynchronous notifications to managers.
Remember
- Polling and traps/informs are independent paths
- An OID identifies an object; the MIB describes structure and semantics
- SNMPv2c community strings are not equivalent to SNMPv3 authentication/privacy
- Restrict management sources and grant the minimum required view/access.
First checks
show snmp— packets in/out and errors (bad community, unknown user, ACL drops).show snmp user/show snmp group— SNMPv3 users and security levels.show snmp host— trap and inform receivers.show running-config | include snmp-server— communities, views, ACLs.- From the manager:
snmpwalk -v3 -l authPriv -u <user> -a SHA -A <pw> -x AES -X <pw> <device> 1.3.6.1.2.1.1— test a read.
Commands
snmp-server community <community> ro- Create a read-only SNMPv2c community; restrict it with an ACL.
snmp-server community <community> rw- Create a read-write SNMPv2c community; avoid it in production.
snmp-server location <text>- Set the SNMP location string.
snmp-server contact <text>- Set the SNMP contact string.
snmp-server host <ip> version 2c <community>- Send SNMPv2c traps to a host.
snmp-server enable traps- Enable sending of SNMP traps.
snmp-server group <group> v3 priv- Create an SNMPv3 group that requires authentication and encryption.
snmp-server user <user> <group> v3 auth ... priv ...- Create an SNMPv3 user with authentication and privacy settings.
show snmp- Display SNMP counters and status.
show snmp community- Display SNMP communities.
show snmp user- Display SNMPv3 users.
show running-configshow udp
Verify in this order
manager polls UDP 161 → ACL permits → community or v3 user authenticates → view allows the OID → agent answers → traps/informs to UDP 162 at the manager
Where it usually breaks
local configuration → reachability/transport → request/negotiation → server or policy decision → response/state installation → client-visible result
SNMP · operational reference
| SNMP mechanism | Purpose | Important caveat |
|---|---|---|
| GET/GETBULK | Poll current objects | Value meaning comes from MIB/object context |
| Counter | Accumulated events/bytes | Usually interpret as delta/rate |
| Trap | Asynchronous notification | No acknowledgment |
| Inform | Notification with acknowledgment | Delivery still depends on manager handling |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=665