SNMP
π A Comprehensive Guide to Simple Network Management Protocol (SNMP)
A simple, practical, and engineer-friendly guide to understanding and revising SNMP β from basics to secure deployment.
π What is SNMP?
Simple Network Management Protocol (SNMP) is a foundational protocol used to monitor and manage network devices such as:
- Routers
- Switches
- Servers
- Printers
- Firewalls
- End-user devices
It allows network engineers to:
β
Monitor device health
β
Track bandwidth & CPU usage
β
Receive real-time alerts
β
Modify configurations remotely
β
Avoid logging into every device manually
π§© 1. Core Components of SNMP
An SNMP-based network has two main parts:
π₯οΈ 1οΈβ£ Network Management Station (NMS)
A central monitoring system that:
- Polls devices
- Collects data
- Displays dashboards
- Sends configuration changes
Think of it as the brain of SNMP operations.
π 2οΈβ£ Managed Devices
These are the actual devices being monitored:
- Cisco routers
- Switches
- Servers
- Firewalls
Each managed device runs an SNMP Entity, which contains:
πΉ SNMP Manager
- Runs on the NMS
- Sends requests (
GET,SET) - Listens for notifications
- Uses UDP Port 162 for traps/informs
πΉ SNMP Agent
- Runs on the managed device
- Listens for requests
- Uses UDP Port 161
- Retrieves data from the deviceβs internal database
πΉ Management Information Base (MIB)
π The database inside the device.
It stores operational values like:
- CPU utilization
- Interface status
- Bandwidth usage
- Temperature
πΉ SNMP Application
The GUI interface on the NMS that shows:
- Traffic graphs
- CPU charts
- Interface errors
- Device health status
π³ 2. Understanding MIBs and OIDs
π What is an OID?
An Object Identifier (OID) uniquely identifies each variable in the MIB.
Example: 1.3.6.1.2.1.2.2.1.8
This represents an interface operational status.
π² OID Structure
- Organized like a tree hierarchy
- Similar concept to DNS structure
- Each number represents a branch
π§ Human-Friendly Translation
Because numeric OIDs are hard to remember, SNMP tools translate them into readable names like:
ifOperStatusCPU UtilizationMemory Usage
π’ Vendor-Specific OIDs
Vendors like Cisco define custom OIDs.
To interpret them:
- Download MIB files from vendor
- Import into NMS
- NMS translates vendor-specific OIDs correctly
π‘ 3. SNMP Operations and Message Types
SNMP operations are grouped into four categories:
π 1οΈβ£ Read Messages (Monitoring)
Used by NMS to retrieve information.
πΉ GET
Requests specific OID values.
πΉ GET-NEXT
Retrieves the next OID in the tree.
Used to βwalk the MIB treeβ.
πΉ GET-BULK (SNMPv2+)
Efficiently retrieves large ranges of OIDs in one request.
βοΈ 2οΈβ£ Write Messages (Configuration)
πΉ SET
Allows modification of device values:
- Enable/disable interfaces
- Trigger system reboot
- Initiate config backup
β οΈ Some OIDs are read-only (e.g., temperature).
π¨ 3οΈβ£ Notification Messages (Alerts)
Unsolicited messages sent by device to NMS.
πΉ TRAP
- No acknowledgment
- If lost β not retransmitted
πΉ INFORM (SNMPv2+)
- Requires acknowledgment
- Retransmitted if no response received
- More reliable than Trap
π 4οΈβ£ Response Messages
πΉ RESPONSE
- Sent by device to reply to GET/SET
- Sent by NMS to acknowledge INFORM
π 4. SNMP Versions & Security Models
There are three major versions:
| Version | Security Model | Key Features |
|---|---|---|
| SNMPv1 | Community Strings | Basic authentication, no encryption |
| SNMPv2c | Community Strings | Adds GET-BULK and INFORM |
| SNMPv3 | User-Based Security | Authentication + Encryption |
π SNMPv1 & SNMPv2c Security
They use Community Strings (plaintext passwords).
πΉ Read-Only (RO)
- Can read data
- Cannot modify
πΉ Read-Write (RW)
- Can read data
- Can modify configurations
β οΈ No encryption β insecure for modern networks.
π SNMPv3 β The Gold Standard
Provides secure communication with three levels:
| Security Level | Authentication | Encryption |
|---|---|---|
| NoAuthNoPriv | β No | β No |
| AuthNoPriv | β Yes | β No |
| AuthPriv | β Yes | β Yes |
π AuthPriv = Most Secure
- Hash-based authentication
- Full encryption
- Protects management traffic
Highly recommended for production networks.
βοΈ 5. Basic SNMP Configuration (Cisco IOS)
πΉ SNMPv2c Configuration
1οΈβ£ Configure Community Strings
R1(config)# snmp-server community MyPassword RO
R1(config)# snmp-server community MyPassword RW
2οΈβ£ Enable Traps
R1(config)# snmp-server enable traps
3οΈβ£ Define NMS Host
R1(config)# snmp-server host 192.168.1.10 version 2c MyPassword
π SNMPv3 Configuration Overview
Steps:
- Create a security group
- Define security level
- Create a user
- Assign authentication & encryption passwords
π― Quick Revision Summary
| Component | Role |
|---|---|
| NMS | Central monitoring system |
| Agent | Software on device |
| MIB | Device database |
| OID | Unique variable identifier |
| GET | Retrieve value |
| SET | Modify value |
| TRAP | Unacknowledged alert |
| INFORM | Acknowledged alert |
| UDP 161 | Agent listening port |
| UDP 162 | Trap/Inform port |
π Conclusion
SNMP is a critical protocol for network operations.
- π Provides real-time metrics
- π¨ Generates alerts
- βοΈ Enables remote configuration
- π Secure with SNMPv3
While SNMPv1 and v2c are simple, SNMPv3 is strongly recommended for modern, secure environments.
π‘ Master SNMP and you master network visibility.