Press "Enter" to skip to content

Category: Tools

SNMPget & SNMPwalk

Lets say in your network you have a lot of routers/switches and when you perform a traceroute you dont know what the hostname is of each device, or for example you need to know more information on the device and what IOS/firmware its running, and what ip addresses are assigned.

For example I need to know what 192.168.1.1 is in my network, and say I have SNMP enabled on my devices we can use a mix of SNMPget and SNMPwalk to find more details. Now this can only be performed on linux, so in this case i am using ubuntu.

root@ubuntu:~# snmpget -v 2c -c public 192.168.1.1 sysName.0
SNMPv2-MIB::sysName.0 = STRING: dd-wrt

sysName.0 shows the device name

root@ubuntu:~# snmpget -v 2c -c public 192.168.1.1 sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux DD-WRT 2.4.35 #2005 Tue May 20 01:17:43 CEST 2008 mips

sysDescr.0 shows the firmware used on device and version

root@ubuntu:~# snmpwalk -c public -v1 192.168.1.1 ipaddr
IP-MIB::ipAdEntAddr.192.168.1.1 = IpAddress: 192.168.1.1
IP-MIB::ipAdEntAddr.200.100.1.1 = IpAddress: 200.100.1.1
IP-MIB::ipAdEntAddr.127.0.0.1 = IpAddress: 127.0.0.1
IP-MIB::ipAdEntAddr.169.254.255.1 = IpAddress: 169.254.255.1
IP-MIB::ipAdEntIfIndex.192.168.1.1 = INTEGER: 7
IP-MIB::ipAdEntIfIndex.200.100.1.1 = INTEGER: 77
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.169.254.255.1 = INTEGER: 7
IP-MIB::ipAdEntNetMask.192.168.1.1 = IpAddress: 255.255.255.0
IP-MIB::ipAdEntNetMask.200.100.1.1 = IpAddress: 255.255.255.255
IP-MIB::ipAdEntNetMask.127.0.0.1 = IpAddress: 255.0.0.0
IP-MIB::ipAdEntNetMask.169.254.255.1 = IpAddress: 255.255.0.0
IP-MIB::ipAdEntBcastAddr.192.168.1.1 = INTEGER: 1
IP-MIB::ipAdEntBcastAddr.200.100.1.1 = INTEGER: 1
IP-MIB::ipAdEntBcastAddr.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntBcastAddr.169.254.255.1 = INTEGER: 1

snmpwalk shows what ip addresses are on that device

  • Note in all the above cases the device has to have SNMP enabled, in corporate networks i would suggest enabling this feature however having a different read-only snmp string other than public due to security implications. Also it is important to know there is 3 types of SNMP versions v1,v2,v3, so you can set it up depending what the device supports. v2 of SNMP is quite common on many devices.

If you wish to know more information on the above utilities visit the websites below:

SNMP Walk:
http://net-snmp.sourceforge.net/docs/man/snmpwalk.html

SNMP Get:
http://net-snmp.sourceforge.net/docs/man/snmpget.html

General SNMP Info:
http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol

[ad#googleadd1]

Leave a Comment