Menu
Motadata free SNMP MIB Browser is a powerful and user friendly tool that provides MIB Browsing and related functions to users. It is an essential tool for engineers to manage SNMP enabled network devices and applications allowing them to load standard, proprietary MIBs. Dear SysAid Lab members! For those of you who want to make the most out of the SNMP network scanning - I would like to forward all of your attention to an open source command line tool for snmp queries you can use to learn a lot about your devices and then configure SysAid to extract and save that information.
Active4 years, 7 months ago
Using SNMP, how do I get the MAC address of the device connected to each port on the switch? We're using HP ProCurve Switches.
I tried using the OID dot1dTpFdbPort but that seems to be giving me the MAC address of every device that's in communication with the switch, not just connected to it.
I'm trying to find the OID that will give me ports 1-48 in a list, and for each port, the MAC (or IP address) of the device connected to that port.
Thanks!
Danny AckermanDanny Ackerman
38911 gold badge44 silver badges1818 bronze badges
4 Answers
Thank you so much raz3r for your answer.It works like a charm !
From your linux server :
$ snmpwalk -v 1 -c public xxx.xxx.xxx.xxx 1.3.6.1.2.1.17.4.3.1.2 | grep 'INTEGER: 11'
(port number 11)
Will return :
SNMPv2-SMI::mib-2.17.4.3.1.2.44.118.138.64.143.95 = INTEGER: 11
SNMPv2-SMI::mib-2.17.4.3.1.2.56.170.60.108.174.57 = INTEGER: 11 SNMPv2-SMI::mib-2.17.4.3.1.2.104.181.153.172.54.237 = INTEGER: 11 SNMPv2-SMI::mib-2.17.4.3.1.2.120.172.192.143.226.236 = INTEGER: 11 SNMPv2-SMI::mib-2.17.4.3.1.2.124.195.161.20.109.76 = INTEGER: 11 SNMPv2-SMI::mib-2.17.4.3.1.2.152.75.225.59.127.180 = INTEGER: 11
Then you can do this to find which Mac Address is connected :
$ snmpwalk -v 1 -c public xxx.xxx.xxx.xxx 1.3.6.1.2.1.17.4.3.1.1 | grep '152.75.225.59.127.180'
Return mac address :
SNMPv2-SMI::mib-2.17.4.3.1.1.152.75.225.59.127.180 = Hex-STRING: 98 4B E1 3B 7F B4
You can make a script.sh to do this..
ethrbunny
7,78277 gold badges4848 silver badges101101 bronze badges
N PN P
You were almost there :) The dot1dTpFdbPort is exactly what are you looking for, the only thing that you need is a link to the real port index.
First, take the value given by dot1dTpFdbPort.
Now query the dot1dBasePortIfIndex with the value you took before.
Let's make an example: Itool for mac.
Windows Snmp Toolsraz3rraz3rSnmp Walk For Windows![]()
1,63866 gold badges3636 silver badges6161 bronze badges
Try this to have the MAC address directly in HEX :
hekhohekho
Netsnmp's
snmptable may be more readable here.
Example
dot1dTpFdb table retrieval:
Free Snmp Walk Tool
Example k1erank1eran
dot1dBasePort table retrieval:
2,11822 gold badges2525 silver badges4242 bronze badges
Not the answer you're looking for? Browse other questions tagged snmp or ask your own question.From SnmpSoft:
SnmpWalk allows you to detect a set of variables that are available for reading on a certain device. You can obtain a full list or just part. By analyzing the results of a network device scan obtained with SnmpWalk you can develop a list of supported MIBs and, in this way, obtain full descriptions of variables and possible values. Besides that, MIB documents contain information about SNMP variables that are available only for writing. After analyzing information retrieved with SnmpWalk from hardware or software SNMP sources, you can use SnmpSet and SnmpGet tools to change and obtain values.
What do you need to know about free software?Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |