How to get the IP address of a remote host from its Ethernet address?

I am looking for Linux code to search for an IP address from an Ethernet address. I suppose I need to do some inverse ARP snag, but I haven't found any example ...

+3
source share
3 answers

http://compnetworking.about.com/od/networkprotocolsip/f/convertipmacadd.htm

Try sending an IP broadcast (for example, ping 192.168.1.255if your subnet is 192.168.1.0/24 ) to transfer your ARP cache, then arp -ato spit it out completely.

+3
source

, , arp. /proc/net/arp, . IP- MAC, , , . , , RARP, - , .

, , arp. . fping . , , ARP, ..

+2

Take a look at Thomas Habet Arping . I have not tried, but the basic idea is to send the ICMP Ping network packet to the appropriate MAC address using the broadcast IP address in the IP header. Only the host with the specified MAC address will respond, and the response will (usually) contain its IP address. This will not always work, but it may be enough for you. See the readme file for restrictions.

0
source

All Articles