AI, and Network Operations and Management · Topic 4 of 6
SNMP in Network Operations
Learn what SNMP does in network operations: manager, agent, MIB and OID, get, set, trap and inform, the v1, v2c and v3 differences and a basic Cisco setup.
- 5 min
- The manager asks questions. The agent answers and sends traps.
- The MIB is the catalog. An OID names one value.
- Get reads, set changes, and a trap is an unsolicited alert.
What it is
SNMP, the Simple Network Management Protocol, lets a management system monitor network devices and, if allowed, change them.
It is how monitoring tools see interface traffic, CPU load, memory and whether a device is up. Without a standard, every vendor would need its own tool. SNMP gives routers, switches, firewalls and printers one common language.
Four parts to know:
- SNMP manager: the management station that asks questions and collects answers. Also called a network management system (NMS).
- SNMP agent: the software on each managed device that answers questions and reports problems.
- MIB (Management Information Base): the organized catalog of values a device can report.
- OID (Object Identifier): the numbered address of one item in the MIB tree, such as one interface counter.
In operations, SNMP is the classic way to poll devices for trend data and to receive alerts when something happens.
How it works
The manager and the agent talk using a small set of operations, in two directions.
The operations
| Operation | Who sends it | Purpose |
|---|---|---|
| Get | Manager | Read one value by OID |
| Get next | Manager | Read the next item, to walk a table |
| Get bulk | Manager | Read many values at once (SNMPv2c and later) |
| Set | Manager | Change a value on the device |
| Response | Agent | Answer to any request |
| Trap | Agent | Unsolicited alert, such as a link going down |
| Inform | Agent | A trap the manager must acknowledge (v2c and later) |
Polling and notifications
Polling means the manager asks on a schedule. Notifications mean the device speaks up on its own. Most networks use both: polling for trend data such as bandwidth over time, and traps for events that cannot wait.
SNMP uses UDP. Requests go to port 161 on the agent. Traps and informs go to port 162 on the manager.
The three versions
| Version | Security | Notes |
|---|---|---|
| SNMPv1 | Community string only | Original, no encryption |
| SNMPv2c | Community string only | Adds get bulk, informs and larger counters |
| SNMPv3 | Users, authentication, optional encryption | The secure choice |
In v1 and v2c, a community string works like a shared password. A read only string allows reading, and a read write string allows changes. It travels in clear text, so anyone who captures the traffic can read it.
The "c" in v2c stands for community. SNMPv2c is not meaningfully more secure than v1.
SNMPv3 security levels
SNMPv3 replaces communities with users and offers three levels:
- noAuthNoPriv: a user name only, with no authentication and no encryption.
- authNoPriv: authenticated, so the sender is known and the message is unchanged, but not encrypted.
- authPriv: authenticated and encrypted.
A basic Cisco setup
snmp-server community MONITOR ro 10
snmp-server host 10.1.1.50 version 2c MONITOR
snmp-server enable traps
access-list 10 permit host 10.1.1.50
- The first line creates a read only community and limits it to the hosts that access list 10 permits.
- The second says where to send notifications and which version and community to use.
- The third turns on trap generation.
- The access list allows only the management station.
The same idea with SNMPv3 uses a group and a user instead of a community string:
snmp-server group NETADMIN v3 priv
snmp-server user NMSUSER NETADMIN v3 auth sha AUTHPASS priv aes 128 PRIVPASS
snmp-server host 10.1.1.50 version 3 priv NMSUSER
Here priv means authentication and encryption, which is the authPriv level.
Checking and troubleshooting
When the management station cannot poll a device, check these in order.
- Is the device reachable on UDP 161, with no firewall or ACL blocking it?
- Does the community string, or the SNMPv3 user and passwords, match on both sides?
- Does the community's access list permit the manager's address?
- Is the version the same on both sides?
The show snmp command displays the counters. A rising count of unknown community names points to a string mismatch.
R1# show snmp
Chassis: FTX1234ABCD
...
12 SNMP packets input
0 Bad SNMP version errors
5 Unknown community name
0 Illegal operation for community name supplied
Common mistakes
Calling a trap a poll. A trap is sent without being asked. A poll is a request from the manager.
Mixing up manager and agent. The agent runs on the managed device. A router is an agent, not a manager.
Leaving write access open. A read write community lets someone change settings. Use read only unless a change is truly needed.
Treating an inform as better in every way. It is acknowledged, but it costs more because the device must wait for the reply and may retry.
Assuming a community string is secret. It is sent in clear text in v1 and v2c.
If a question asks which version is secure, the answer is SNMPv3, and the level that also encrypts is authPriv.
What to remember for the exam
- The manager asks questions. The agent answers and sends traps.
- The MIB is the catalog. An OID names one value.
- Get reads, set changes, and a trap is an unsolicited alert.
- An inform is a trap that must be acknowledged.
- SNMPv1 and v2c use community strings sent in clear text.
- SNMPv3 adds user authentication and optional encryption. The level with both is authPriv.
- Polling is manager initiated. Traps and informs are device initiated.
- Agent queries use UDP 161. Traps and informs use UDP 162.
Check yourself
What are the roles of the manager, the agent and the MIB, and how does an OID relate to them?
The manager asks questions and collects answers, the agent on the managed device answers and reports problems, and the MIB is the catalog of values a device can report. An OID is the numbered address of one item in the MIB tree.
How does a trap differ from an inform, and which gives the sender confirmation?
A trap is an unsolicited alert from the device, and an inform is a trap the manager must acknowledge. The inform gives the sender confirmation.
Why is SNMPv3 more secure than v2c, and which of its levels adds encryption?
SNMPv3 uses users with authentication and optional encryption, while v2c uses only a clear text community string. The
authPrivlevel adds encryption.
Topic 4 of 6 in AI, and Network Operations and Management
Test yourself on AI, and Network Operations and Management
The full Cisco CCNA 200-301 v2.0 question bank has 1,242 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.