Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the MAC address of the remote host

I just a moment ago saw a request for finding the MAC adress of a remote host. An answer was that the MAC address is always sent as part of the TCP/IP protocol.

How would I go about retrieving this information from an ASP.NET C# application?

See: Reference to sister-post

like image 962
jAST Avatar asked Nov 28 '22 20:11

jAST


2 Answers

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.

like image 52
John Saunders Avatar answered Dec 05 '22 22:12

John Saunders


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.

like image 25
Brian Agnew Avatar answered Dec 06 '22 00:12

Brian Agnew