I have an IP address of a computer which I am currently away from, and I need the MAC address. How do I get the MAC address if I ony have the IP?
-
1possible duplicate of Resolving an IP address of a Remote machine to its MAC address– Gilles 'SO- stop being evil'Commented Jul 30, 2014 at 14:43
-
1@Gilles, That question is related to email. The answers in both threads differ.– PacerierCommented Nov 10, 2015 at 11:08
-
Might be easy if it's an IPv6 address (sometimes MAC addresses are part of public IPv6 addresses).– GeremiaCommented Mar 16, 2017 at 19:36
-
its unacceptable that this question is voted as Off Topic. Its actually lack of brains.– DenisCommented Mar 29, 2018 at 7:42
2 Answers
In short the answer will be you can't.
It is usually not possible for a person to get the MAC address of a computer from its IP address alone. These two addresses originate from different sources. Simply stated, a computer's own hardware configuration determines its MAC address while the configuration of the network it is connected to determines its IP address.
However, 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. Using ARP, each computer maintains a list of both IP and MAC addresses for each device it has recently communicated with.
-
5And that short answer is wrong. One can always do an ARP lookup to determine the MAC of an IP. The only thing is that you probably are not seeing the actual IP of a device (due to NAT), if you're on separate networks. Commented Jul 30, 2014 at 9:42
-
10The above comment is wrong. If you do an ARP lookup for an IP that's not on the same network, you will generally get no reply. There are some cases where ARP masquerading is configured and will reply, but it's quite rare to do that as it causes other problems.– pjc50Commented Jul 30, 2014 at 9:49
-
3@pjc50 Getting no replay does not prevent one from attempting an ARP lookup. My main point is that you can always do a lookup. And, if you're on the same network, you will always get what you were looking for. That's how the Ethernet protocol works. Otherwise there would be no IP packet exchange on the network, because NICs would not be able to resolve IPs to MACs. Commented Jul 30, 2014 at 9:53
-
5@U-D13
I have an IP address of a computer which I am currently away from
,in the question probably meant that the user is trying to find the MAC address of a computer which is not on the same network. So in that case the answer is right– ShivaCommented Jul 30, 2014 at 9:57 -
3@Shiva "probably meant". I can be away from my colleagues computer, but we're on the same network. I can be working from home via VPN and be away from my actual work machine, yet we're still on the same network. I strongly believe your answer should be reworded to clearly indicate that one can only resolve IPs to MACs in a local network, but one can always do that. Commented Jul 30, 2014 at 10:04
If you are on the same network you can open up a Terminal:
ping your_ip_address
hit Ctrl-C on the keyboard to stop pinging then do a:
arp -a
a list should appear, look for the ip you just pinged and next to it is the MAC address of the device.
-
7
-
-
Does this works on Linux? Tried and definitely works on windows 10. Commented Sep 8, 2016 at 8:04
-
5This only works if both hosts are on the same network, if it is in a virtual network for example it will not work Commented May 19, 2017 at 14:08
-
3As one command, and suppressing the ping output and irrelevant MAC addresses:
IP=192.168.0.118; ping -c 1 "$IP" >/dev/null && arp -a | grep "$IP"
– taniusCommented Mar 31, 2018 at 16:25