Skip to content

Conversation

PcTim
Copy link

@PcTim PcTim commented Apr 16, 2016

I've included a command to get the mac address of the pinged device. I also included this function to the Ping examples.

@blfoster
Copy link

blfoster commented Apr 17, 2016

MAC addresses are part of the link layer, which means that they are only relevant on your local network. If your ICMP request passes through an IP router*, you'll get the MAC address of the router rather than the MAC address of the destination. IP routing hides the technology used by the destination network interface from you. It could, in theory, not have a MAC address.

* Note: although a residential gateway is often called a router, these devices only use IP routing for destinations outside your network. Everything internal is MAC. It's analogous to an Ethernet switch plugged into a router with only 2 interfaces (with the other interface connected to the outside world).

@PcTim
Copy link
Author

PcTim commented Apr 23, 2016

You're right. Thank you for your explanation. As you say MAC addresses are relevant on my local network and such this functionality is useful if you want to check which device is assigned to which IP address.
In our project we want to scan the local network to create a network statistic for every device. See https://github.com/powtac/Autarc_LAN_User_Stats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants