Finding IP Address from MAC of a device in a different subnet

3

I am new to networking as such, but I have been searching a lot about the problem of finding IP from MAC for the past couple of days. I have a device whose MAC address I know and I have an Android app running in my smart phone. I need to find the IP of the said device so that I can send requests to it.

On the same subnet the ways I found were to either use an external cloud server or to ping all devices in the subnet and read the ARP table. I don't want to use an external server so I went with ARP and its working fine...

However, for the case of a different subnet I am not sure how to accomplish this. Is this possible? If it is not, addition of what extra knowledge could make it possible?

Let's say I have the IP of the router that the device is connected to or the Gateway IP which the device connects to..can I use any of those to reach the device's subnet somehow? ( I really am pretty new so bear with me if I am saying something stupid)

Gaurav Fotedar

Posted 2016-01-06T13:52:11.187

Reputation: 133

2It's not possible. MAC addresses do not cross Routers/Switches etc. – DavidPostill – 2016-01-06T14:20:59.813

I understand that much. However, is it not possible to ping all devices in a different subnet if I know the IP of the router for that subnet? – Gaurav Fotedar – 2016-01-06T14:40:33.537

1You can ping any device anywhere (as long as it is connected and pings are not blocked). However you cannot get a MAC Address using ping. – DavidPostill – 2016-01-06T14:43:27.100

1Ping to a different private subnet is only possible if they share the same gateway and have appropriate subnet masks. – DavidPostill – 2016-01-06T14:50:06.687

1There is no universal solution to this issue, so usually the only remaining workaround is to look for services on the box that may leak the MAC, like Samba/CIFS, SNMP, or WMI. each of them can be interrogated to retrieve the MAC. – Frank Thomas – 2016-01-06T15:54:13.223

@DavidPostill, MAC addresses are visible over an entire switch fabric (though you are quite correct, they never cross routers, or translational bridges). I point this out not to nitpick, but because it implies that any switch in the switch fabric may contain the desired MAC in its ARP table, not just the one the end terminal is directly connected to. When a unicast frame goes out a switch port, the switch and ARP tables records that that destination MAC and IP can be reached via that port. this is important for links between switches within a LAN. – Frank Thomas – 2016-01-06T23:45:28.697

@FrankThomas Thanks for the correction - I wasn't completely sure about switches. By switch fabric you mean multiple switches connected together with no intervening router or bridge? – DavidPostill – 2016-01-06T23:48:39.443

You really should rethink your original solution. There are subnets with tens of thousands of possible IP addresses and the ARP queries are broadcasts. Pinging an entire subnet is severely antisocial behavior. However you got painted into this corner, take a big step back and see if you can just do whatever it is you're trying to do some completely different way -- possibly one that has nothing to do with MAC addresses. – David Schwartz – 2016-01-06T23:59:12.180

1

@DavidPostill, "Switch fabric" is a topology-agnostic term for a set of interconnected layer2 intermediary systems (switches, bridges, or even repeaters), with a connotation of focus on hardware and cable plant. usually they are depicted graphically as a Mesh since its kind of a maximally complicated example, but a single isolated switch is a fabric unto itself (in fact the original definition came from crossbar switch design, for backplanes). Since they are layer2 devices, its comparable to a Broadcast domain, absent VLan or P2P-link scenarios. https://en.wikipedia.org/wiki/Switched_fabric

– Frank Thomas – 2016-01-07T00:16:06.013

Thanks a lot all of you for helping me :). ok another way...what if I know the DHCP server IP which gives the device its IP Address. Is there a way to query it with MAC and get the IP? I saw in some links that DHCP servers maintain a table with IPs and corresponding MAC addresses, but nobody mentioned how to access it from a program? – Gaurav Fotedar – 2016-01-07T05:17:37.027

Ok one of the links does say that it's not possible...but that was 2009. Is it still true? – Gaurav Fotedar – 2016-01-07T05:21:52.580

No answers