Menu
Find a device using IMC. Post navigation. Previous Previous post: Finding the location of a device using an IP or MAC Address in HP intelligent Management Centre IMC (like you could in ProCurve Manager) Leave a Reply Cancel reply. Want to find MAC address 10:02 AM. Hi, The Mac Address is listed on a label on te back of the printer, as well you may print a Network Configuration Page from teh printer menu to locate its Mac Address. † The opinions expressed above are the personal opinions of the authors, not of HP.
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 Ackerman38911 gold badge44 silver badges1717 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
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...
ethrbunny7,79077 gold badges4747 silver badges9595 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:
raz3rraz3r1,61366 gold badges3636 silver badges6161 bronze badges
Try this to have the MAC address directly in HEX :
![Hp imc find mac address windows 10 Hp imc find mac address windows 10](/uploads/1/2/5/8/125827021/873823051.png)
hekhohekho
Netsnmp's
snmptable
may be more readable here.Example
dot1dTpFdb
table retrieval:Example
k1erank1erandot1dBasePort
table retrieval:2,08422 gold badges2525 silver badges4242 bronze badges
Not the answer you're looking for? Browse other questions tagged snmp or ask your own question.
TCP/IP computer networks use both the IP addresses and MAC addresses of connected client devices. While the IP address changes over time, the MAC address of a network adapter always stays the same.
There are several reasons you might want to know the MAC address of a remote computer, and it's easy to do by using a command line utility such as Command Prompt in Windows.
A single device can possess multiple network interfaces and MAC addresses. A laptop computer with Ethernet, Wi-Fi, and Bluetooth connections, for example, has two or sometimes three MAC addresses associated with it, one for each physical network device.
Why to Figure Out a MAC Address?
Reasons to track down the MAC address of a network device include:
- To set up MAC address filtering on a router to restrict local network access to only those devices whose addresses match a list of presets.
- To determine the device's manufacturer (first half of the address) and serial number (second half of the address) for service.
- To masquerade (spoof) the identity of a different device. MAC addressing spoofing can be used legitimately to register a home network gateway device with an internet provider. It can also have malicious intent, such as to defeat the MAC address filtering feature to break into the network.
Limitations of MAC Address Lookups
It isn't usually possible to look up MAC addresses for devices that are outside a person's physical reach. It often isn't possible to determine the MAC address of a computer from its IP address alone because these two addresses originate from different sources.
A computer's hardware configuration determines its MAC address, while the configuration of the network it is connected to determines its IP address.
However, if the computers are connected to the same TCP/IP network, you can determine the MAC address through a technology called ARP (Address Resolution Protocol), which is included with TCP/IP.
Using ARP, each local network interface tracks both the IP address and MAC address for each device it has recently communicated with. Most computers let you see this list of addresses that ARP has collected.
How to Use ARP to Find a MAC Address
In Windows, Linux, and other operating systems, the command line utility arp shows local MAC address information stored in the ARP cache. However, it only works within the small group of computers on a local area network (LAN), not across the internet.
There's another method used to find the MAC address of the computer you're currently using, which involves using the ipconfig /all command in Windows.
ARP is intended to be used by system administrators and is not a typically useful way to track down computers and people on the internet.
Here is one example of how to find a MAC address via an IP address. Start by pinging the device you want the MAC to address for:
You will want to use a local address, so if your network is 10.0.1.x, then use that number to ping, as in the image below.
The ping command establishes a connection with the other device on the network and should show a result like this:
Use the following arp command to get a list that shows the MAC address of the device you just pinged:
The results may look something like this but probably with many other entries:
Find the device's IP address in the list; the MAC address is shown right next to it. In this example, the IP address is 192.168.86.45 and its MAC address is 98-90-96-B9-9D-61 (they're in bold here only for emphasis).