Basic SNMP Configuration
Basic SNMP Configuration
Section titled âBasic SNMP ConfigurationâTL;DR (Quick Start)
Section titled âTL;DR (Quick Start)âFor the impatient: hereâs the 30-second version.
# Enable SNMP with read-only community/snmp set enabled=yes/snmp community add name=public addresses=192.168.88.0/24 read-access=yes write-access=noOverview
Section titled âOverviewâThis guide demonstrates how to configure SNMP on MikroTik RouterOS for network monitoring.
Prerequisites
Section titled âPrerequisitesâ- A MikroTik router running RouterOS 7.x or later
- Access to the router via SSH, WinBox, or WebFig
Configuration Steps
Section titled âConfiguration StepsâStep 1: Enable SNMP
Section titled âStep 1: Enable SNMPâEnable the SNMP service with basic settings:
/snmp set enabled=yes contact="admin@example.com" location="Server Room A"Step 2: Create an SNMP Community
Section titled âStep 2: Create an SNMP CommunityâCreate a read-only SNMP community:
/snmp community add name=monitoring addresses=192.168.88.0/24 read-access=yes write-access=no comment="Monitoring system"Step 3: Create a Write Community
Section titled âStep 3: Create a Write CommunityâCreate a community with write access for management:
/snmp community add name=management addresses=192.168.88.10/32 read-access=yes write-access=yes comment="SNMP management"Verification
Section titled âVerificationâCheck 1: SNMP Service Status
Section titled âCheck 1: SNMP Service Statusâ/snmp printExpected Output:
enabled: yes contact: admin@example.com location: Server Room A engine-id: trap-target: trap-community: public trap-version: 1 trap-generators:Check 2: SNMP Communities
Section titled âCheck 2: SNMP Communitiesâ/snmp community printExpected Output:
Flags: * - default, X - disabled # NAME ADDRESSES SECURITY READ-ACCESS WRITE-ACCESS 0 * public none yes no 1 monitoring 192.168.88.0/24 none yes no 2 management 192.168.88.10/32 none yes yesCheck 3: Test SNMP (from monitoring system)
Section titled âCheck 3: Test SNMP (from monitoring system)â# From Linux/monitoring serversnmpwalk -v2c -c monitoring 192.168.88.1 systemTroubleshooting
Section titled âTroubleshootingâProblem: SNMP queries not working
Section titled âProblem: SNMP queries not workingâSymptoms: Monitoring system cannot poll router, snmpwalk times out.
Causes & Solutions:
-
Source IP not allowed - Check community addresses:
/snmp community printAdd monitoring server IP to allowed addresses.
-
Wrong community string - Verify community name matches exactly (case-sensitive).
-
SNMP service disabled - Enable SNMP:
/snmp set enabled=yes -
Firewall blocking SNMP - Allow UDP 161 from monitoring network:
/ip firewall filter add chain=input action=accept protocol=udp dst-port=161 src-address=192.168.88.0/24
Problem: SNMP traps not received
Section titled âProblem: SNMP traps not receivedâSymptoms: Monitoring system doesnât receive SNMP traps.
Causes & Solutions:
-
Trap target not configured:
/snmp set trap-target=192.168.88.50 -
Trap generators not enabled:
/snmp set trap-generators=interfaces,start-trap -
Firewall blocking outbound traps - Allow UDP 162 outbound.
Problem: Write access not working
Section titled âProblem: Write access not workingâSymptoms: Cannot modify router via SNMP SET commands.
Causes & Solutions:
-
Community has no write access:
/snmp community printEnsure
write-access=yesfor the community. -
Using SNMPv1 - Some write operations require SNMPv2c or v3.
Problem: High CPU during SNMP polling
Section titled âProblem: High CPU during SNMP pollingâSymptoms: Router CPU spikes during SNMP queries.
Causes & Solutions:
-
Polling too frequently - Reduce polling interval on monitoring system.
-
Polling too many OIDs - Query only needed OIDs rather than walking entire MIB.
-
Many concurrent queries - Stagger polling from multiple monitoring systems
Related Topics
Section titled âRelated TopicsâSecurity
Section titled âSecurityâ- Firewall Basics - restrict SNMP access by IP
- User Management - SNMPv3 authentication
Monitoring Integration
Section titled âMonitoring Integrationâ- Logging - SNMP traps complement logging
- Graphing - built-in graphing alternative
- Torch - real-time traffic monitoring
Related Topics
Section titled âRelated Topicsâ- Scheduler - scheduled SNMP queries via scripts