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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With