SNMP Testing with net-snmp

NetCraftsmen®

With most network management systems and network security systems, SNMP is a critical component. One great tool for checking SNMP functionality is net-snmp. This tool works with Windows and Linux. From a security perspective, this net-snmp can be used as another troubleshooting tool to ensure that Cisco MARS and Cisco NCM are working correctly.

One basic tool, included with the toolset, is snmpwalk. This can be used to determine the OIDs used for a network device. Here’s a partial execution of the command against a Cisco 2523 router.

 snmpwalk -c cisco -v 1 10.1.1.200 | more
SNMPv2-MIB::sysDescr.0 = STRING: Cisco Internetwork Operating System Software
IOS ™ 2500 Software (C2500-IK8OS-L), Version 12.2(32), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Fri 02-Dec-05 16:15 by
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.9.1.27
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1229180359) 142 days, 6:23:23.59
SNMPv2-MIB::sysContact.0 = STRING:
SNMPv2-MIB::sysName.0 = STRING: termserv-R5
SNMPv2-MIB::sysLocation.0 = STRING:
SNMPv2-MIB::sysServices.0 = INTEGER: 78
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
IF-MIB::ifNumber.0 = INTEGER: 4
IF-MIB::ifIndex.1 = INTEGER: 1

You can see that all the MIB OID values by adding the “-O n” option. By just typing “snmpwalk” you can get the full list of command line options. The use of “-O n” is shown below

snmpwalk -O n -c cisco -v 1 10.1.1.200
.1.3.6.1.2.1.1.1.0 = STRING: Cisco Internetwork Operating System Software
IOS ™ 2500 Software (C2500-IK8OS-L), Version 12.2(32), RELEASE SOFTWARE(fc1)
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Fri 02-Dec-05 16:15 by
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.9.1.27
.1.3.6.1.2.1.1.3.0 = Timeticks: (1229164596) 142 days, 6:20:45.96
.1.3.6.1.2.1.1.4.0 = STRING:
.1.3.6.1.2.1.1.5.0 = STRING: termserv-R5
.1.3.6.1.2.1.1.6.0 = STRING:
.1.3.6.1.2.1.1.7.0 = INTEGER: 78
.1.3.6.1.2.1.1.8.0 = Timeticks: (0) 0:00:00.00
.1.3.6.1.2.1.2.1.0 =
INTEGER: 4
.1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1

You can then use this information to be more specific with your SNMP requests by using snmpget. Using the example above, we can just get the version information for the 2523 router by executing the command below

snmpget -c cisco -v 1 10.1.1.200 .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Cisco Internetwork Operating System Software
IOS ™ 2500 Software (C2500-IK8OS-L), Version 12.2(32), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Fri 02-Dec-05 16:15 by

2 responses to “SNMP Testing with net-snmp

  1. Don’t forget that you can also use any unique symbolic name as an argument to snmpwalk or snmpget as well.

    So, sysName.0 or ifName.1 should work nicely.

Leave a Reply

 

Nick Kelly

Cybersecurity Engineer, Cisco

Nick has over 20 years of experience in Security Operations and Security Sales. He is an avid student of cybersecurity and regularly engages with the Infosec community at events like BSides, RVASec, Derbycon and more. The son of an FBI forensics director, Nick holds a B.S. in Criminal Justice and is one of Cisco’s Fire Jumper Elite members. When he’s not working, he writes cyberpunk and punches aliens on his Playstation.

 

Virgilio “BONG” dela Cruz Jr.

CCDP, CCNA V, CCNP, Cisco IPS Express Security for AM/EE
Field Solutions Architect, Tech Data

Virgilio “Bong” has sixteen years of professional experience in IT industry from academe, technical and customer support, pre-sales, post sales, project management, training and enablement. He has worked in Cisco Technical Assistance Center (TAC) as a member of the WAN and LAN Switching team. Bong now works for Tech Data as the Field Solutions Architect with a focus on Cisco Security and holds a few Cisco certifications including Fire Jumper Elite.

 

John Cavanaugh

CCIE #1066, CCDE #20070002, CCAr
Chief Technology Officer, Practice Lead Security Services, NetCraftsmen

John is our CTO and the practice lead for a talented team of consultants focused on designing and delivering scalable and secure infrastructure solutions to customers across multiple industry verticals and technologies. Previously he has held several positions including Executive Director/Chief Architect for Global Network Services at JPMorgan Chase. In that capacity, he led a team managing network architecture and services.  Prior to his role at JPMorgan Chase, John was a Distinguished Engineer at Cisco working across a number of verticals including Higher Education, Finance, Retail, Government, and Health Care.

He is an expert in working with groups to identify business needs, and align technology strategies to enable business strategies, building in agility and scalability to allow for future changes. John is experienced in the architecture and design of highly available, secure, network infrastructure and data centers, and has worked on projects worldwide. He has worked in both the business and regulatory environments for the design and deployment of complex IT infrastructures.