To check the local ARP tables, Linux, OS X, Solaris and Windows all provide an arp command-line utility, but the syntax is likely to vary.
HOW TO FIND IP ADDRESS USING MAC ADDRESS CRESTRON PORTABLE
If after all that, you're still determined, look into libpcap/ WinPCap for packet capturing, which is the most portable option which comes to mind. Whether you are in a corporate environment or at home, each computer is being assigned an IP address from a DHCP server (unless it’s a static network, which is rare). An internal IP address (local or private) is only used within your home network and always for a single device.
Both of these options are very platform-dependent!Īlso, neither option is likely to continue working without modification if the interfaces you're dealing with aren't Ethernet interfaces (perhaps they're PPP links, or WiFi, or a funky virtualized interface of some sort. The simplest way to get an IP address from a MAC address is to check out the DHCP server, if possible. Before you find your Mac IP address, it’s important to know the difference between the two kinds of IP addresses internal and external. Your options are pretty much limited to either packet-capturing on the network interface you're listening on to get the entire packet, or using whatever tools your system provides to check the local ARP table. but this gets stripped off before the packet is delivered to your application. If the peer machines are on the same subnet, then the incoming packets will contain the MAC address of the peer in the Ethernet header. Only the router nearest to the peer machine will know what the MAC address of the peer is - and this information isn't passed on. If your peer machines are on a different subnet (and therefore traffic between you and the peer is passing through a router), then there's no way to do what you want - the MAC address of the packets you receive will be the MAC address of the router which forwarded them to you, as that's the link-layer device you're communicating with.
Unfortunately, the simple answer is really "don't do that".