Table of Contents

SNMP

  1. SNMP Version 1: The first version of SNMP to be implemented, version 1 was designed to be a protocol to provide device statistics and error reporting without consuming a lot of system resources. Security was limited to community strings and access controls based on the IP address of the querying server. Data communication wasn't encrypted.
  2. SNMP Version 2: The second version of SNMP, often referred to as v2c, expanded the number of supported error codes, increased the size of counters used to track data, and had the ability to do bulk queries that more efficiently loaded response packets with data. SNMP v2c is backward compatible with version 1.
  3. SNMP Version 3: This version provides greater security and remote configuration capabilities than its predecessors. Access isn't limited to a single community string for read-only and read/write access, as

usernames and passwords have been introduced. Views of OIDs in a MIB can also be limited on a per-user basis. Support for encrypted SNMP data transfer and transfer error detection is also provided.

SNMP Utils

Install (Ubuntu)

sudo apt-get install snmp

Usage

snmpwalk -v 1 -c iptel 147.10.17.96
snmpwalk -v 1 -c craz33guy localhost interface
snmptrap -v 2c -c iptel -d 10.80.100.38 1002 1.3.6.1.4.1.161.1.1.0

SNMP Server

Install

sudo apt-get install snmpd

Configuration

SNMP

mv /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf.org
rocommunity  iptel
syslocation  "17/320 Pitt St, Sydney"
syscontact  eduardo.ferreira@team.telstra.com
# snmpd options (use syslog, close stdin/out/err).
# replace 204.x.y.z with your public IP
# SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1 204.x.y.z'
 
# snmptrapd control (yes means start daemon).  As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
# can be run.  See snmpd.conf(5) for how to do this.
TRAPDRUN=yes
# For Community String iptel
authCommunity log,execute,net iptel

# Log to syslog with facility level 2
logOption s 2
sudo /etc/init.d/snmpd restart

SNMPv3

sudo /etc/init.d/snmpd stop 
server:/$ sudo net-snmp-config --create-snmpv3-user -ro -a MD5 -A pocketmonster iptel

adding the following line to /var/lib/snmp/snmpd.conf:
   createUser iptel MD5 "pocketmonster" DES
adding the following line to /usr/share/snmp/snmpd.conf:
   rouser iptel

server:/$
server:/$ sudo net-snmp-config --create-snmpv3-user -ro -a MD5 -A pocketmonster -x DES -X pocketmonster iptel

adding the following line to /var/lib/snmp/snmpd.conf:
   createUser iptel MD5 "pocketmonster" DES pocketmonster
adding the following line to /usr/share/snmp/snmpd.conf:
   rouser iptel

server:/$
sudo /etc/init.d/snmpd stop 
createUser securev3user MD5 "mandeville" DES savlamar
createUser username4snmpv3 MD5 "rootsrockreggae" DES
usmUser 1 3 0x80001f88780711168720eb1e745
0x73656375626576337573657200
0x73656375726576337573657200
NULL .1.3.6.1.6.3.10.1.1.2 0xd951
ac1d95033f4afgf31243eb6907df .1.3.6.1.6.3.10.1.2.2
0xf1f4bb00452211d27b50c273c09031ac 0x00
usmUser 1 3 0x80001f8880711168720eb1e745
0x757365726e61657534736e6d70763300
0x757365726e616d6534736e6d70763300
NULL .1.3.6.1.6.3.10.
1.1.2 0x5e35c9f5352519aa4f53eded09bbdddd
.1.3.6.1.6.3.10.1.2.2 0x5e35c9f5122519aa4f53eded09bbdddd ""
setserialno 1464593474
[root@server ~]# snmpget -v 3 -u iptel -l authNoPriv -a MD5 -A pocketmonster 147.10.33.67 SNMPv2-MIB::sysORDescr.8
SNMPv2-MIB::sysORDescr.8 = STRING: The management information definitions for the SNMP User-based Security Model.
[root@server ~]#
[root@server ~]# snmpget -v 3 -u iptel -l authPriv -a MD5 -A pocketmonster -x DES -X pocketmonster 147.10.33.67 SNMPv2-MIB::sysORDescr.8
SNMPv2-MIB::sysORDescr.8 = STRING: The management information definitions for the SNMP User-based Security Model.
[root@server ~]#