When a device is configured with SNMP, we normally need a tool to confirm if the configuration is correct. For this, I normally use snmpwalk which part of the NET-SNMP package which can be easily installed in any Linux distribution. For SNMP version2 testing, this is fairly straightforward for those show have been using SNMPv2 for a long while.
Testing SNMP version 3 configuration is not a simple walk through the park as there are many variations in configuring SNMPv3 on a device. I would advice reading a bit on SNMPv3 and learn the specific configuration on your device (if supported).
Let see the snmpwalk command for version3.
Testing SNMP version 3 configuration is not a simple walk through the park as there are many variations in configuring SNMPv3 on a device. I would advice reading a bit on SNMPv3 and learn the specific configuration on your device (if supported).
Let see the snmpwalk command for version3.
snmpwalk -v 3 -l <level> -u <username> -a <authtype> -x <privtype> -A <authpass> -X <privpass> <target> <oid>
As you can see, there are several arguments for the commands all within the "< >" are variables. Below is a sample output from the command
# snmpwalk -v 3 -l authPriv -u snmpuser -a MD5 -x AES -A snmpauthpass -X snmprivpass 192.168.0.11 system
SNMPv2-MIB::sysDescr.0 = STRING: HP Comware Platform Software, Software Version 5.20.99 Release 2220P09
HP A5120-48G-PoE+ EI Switch with 2 Interface Slots
Copyright (c) 2010-2013 Hewlett-Packard Development Company, L.P.
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.25506.11.1.36
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (3400412358) 393 days, 13:35:23.58
SNMPv2-MIB::sysContact.0 = STRING: IT ServiceDesk ([email protected] / 000000000)
SNMPv2-MIB::sysName.0 = STRING: CORP-BLDG1-SW-5120
SNMPv2-MIB::sysLocation.0 = STRING: CORP-BLDG1-DATAROOM
SNMPv2-MIB::sysServices.0 = INTEGER: 78
As you can see on the output, we managed to pull the SNMP data from target device (IP: 192.168.0.11) using the "system" for the OID. The version3 security level used is "authPriv" as such we would need "MD5" for the authtype and "AES" for the privtype. The username "snmpuser", authpass "snmpauthpass" and privpass "snmpprivpass" are used accordingly in the command.