I have my friend's mac address how can I get his IP address? Is there any command which will take mac address and give us an IP-address?
2 Answers
If you are on the same local network, your friend's current IP address can be shown on your computer using the following command:
sudo arp-scan -l | grep "00:11:22:33:44:55"
Where 00:11:22:33:44:55
represents his mac address.
-
what is local network?You mean that even if I have some one's mac address and they are not in the same local network it would not work?– UdeshJan 26, 2021 at 7:04
-
2Here is some information from the arp-scan -l documentation: "Generate addresses from network interface configuration. Use the network interface IP address and network mask to generate the list of target host addresses. The list will include the network and broadcast addresses, so an interface address of 10.0.0.1 with netmask 255.255.255.0 would generate 256 target hosts from 10.0.0.0 to 10.0.0.255 inclusive." So it only works for computers on the same network (subnet). E.g. the MAC address is not transferred by the router to the Internet, so you can not do online MAC address to IP lookup.– JeaJan 26, 2021 at 7:13
You can simply read the mac address table on your frien machine, then "grep" the output to show its IP address like
arp -a | grep "00:11:22:33:44:55"
00:11:22:33:44:55
representing the mac-address