Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to find out MAC address of directly wired connected device?

I would like to read MAC address of attached device at the other side of the wire. Suppose to have 2 device, that are directly connected by wire. The first one (DeviceX) has Ethernet interface already configured (Static IP ....). The second one (DeviceY) doesn't know anything about DeviceX , but they are physically connected.

There are some way to read DeviceX MAC Address from DecviceY ? It's possible to send some particular packet from DeviceY in such a way the DeviceX reply with some packet ?

I have free access to network API for DeviceY, but about DeviceX i can't do anything.

Thanks in advance.

like image 731
arthur86 Avatar asked Jun 14 '13 06:06

arthur86


People also ask

Do wired devices have a MAC address?

Your MAC address is unique to your computer. On a computer with both a wired and a wireless connection (many laptops and notebooks), there will be one MAC Address for the wired (Ethernet) connection and a second MAC for the wireless connection.


1 Answers

Computers connected to the same TCP/IP local network can determine each other's MAC addresses. The technology called ARP - Address Resolution Protocol included with TCP/IP makes it possible.

From Windows terminal "arp -a" gives the list of ARP entries

For more on ARP go to this link

____EDIT_____

@arthur86 This can be done by sending "Gratuitious ARP" from Device X (broadcast). A gratuitous ARP request is an AddressResolutionProtocol request packet where the source and destination IP are both set to the IP of the machine issuing the packet and the destination MAC is the broadcast address ff:ff:ff:ff:ff:ff.

Device Y will have its arp cache updated with Device X MAC. Using the arp cache entries, Device Y can get the IP and MAC of Device X.

Check this link for details about Gratuitious ARP

like image 126
hazzelnuttie Avatar answered Oct 21 '22 23:10

hazzelnuttie