Getting the MAC address of the remote host

拥有回忆 提交于 2019-11-28 11:37:32

Any such answer is false. The MAC address of an adapter is only available on the same network segment. Not on the other side of a router.

If your remote device is SNMP-enabled you can query it for its ARP cache. That will have the MAC address in it. See this FAQ entry for more info.

Simple Answer: You can't.

Complex answer: You can, but you need to read the output from "arp -a" command. That might get difficult, depending on how many connections you currently have through your NIC (wireless or wired).

tvanfosson

The only way that I can think of to get this from the network itself depends on interfacing with network management software with SNMP or RMON. Currently, I'm using a Java Applet on the client (see my answer to the other question), but it has some limitations. I'm hoping to meet with our network engineers to see if there is a way to get the same information server-side by interrogating the network switches. If such a solution exists, it will likely be specific to whatever network management software you are running.

You can build it into the application itself and have the application send the mac address in any messages that it may already be sending. Other than that, John nailed it.

Edit: Oh, if this is a "web app" and the "client app" is a browser, yeah, no go.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!