How to find IP address of device connected on the same network as PC based on MAC id

43,623

Solution 1

I believe that on the Windows machine you can enter:

arp -a

at which point it will list all the MAC address and IP address the computer knows about.

If it's not listed there, you could consider installing nmap on your Windows machine. Then, have nmap scan the whole subnet for devices:

nmap -sP 192.168.1.0/24

Solution 2

On the PC try

 arp -a

this basically show a map between mac and IP.

This implies device somehow has an IP, which I assumed is the case.

Solution 3

If the device has communicated on the same network in the last 30 seconds (or whatever your arp timeout is set to) then you see both its IP and the MAC with arp -a.

This works for both Linux, Windows, BSDs and probably for a lot more OS's.

Examples:

> toad:/home/user>arp -a
toad.stack.nl (131.155.140.135) at 00:26:b9:66:89:49 on vlan140 permanent [vlan]
websites.stack.nl (131.155.140.165) at 00:26:b9:66:89:49 on vlan140 permanent [vlan]
toad.nfs.ipv4.stack.nl (192.168.2.135) at 00:26:b9:66:89:49 on vlan2 permanent [vlan]
C:\Users\username>arp -a

Interface: 192.168.1.12 --- 0xb
  Internet Address      Physical Address      Type
  192.168.1.2           08-00-37-43-8d-78     dynamic
  192.168.1.101         a0-b3-cc-2a-77-10     dynamic
  192.168.1.252         00-1e-e5-7a-47-5b     dynamic
  192.168.1.255         ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static

Interface: 192.168.81.1 --- 0x12
  Internet Address      Physical Address      Type
  192.168.81.255        ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static

Interface: 192.168.184.1 --- 0x13
  Internet Address      Physical Address      Type
  192.168.184.255       ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static

If the device has not been active on the network for a while then the information in the ARP cache will get dropped. This prevent old information from cluttering the tables and prevent problems when a device changes its IP while the table still has the old MAC:IP pair.

In such a case you might want to send an ARPping to the device or ping all devices on the local network.

Nmap or zenmap (Nmap plus graphical interface) are useful tools for this and work on both Linux and windows. (I mostly use zenmap on windows).

Share:
43,623

Related videos on Youtube

ART
Author by

ART

Updated on September 18, 2022

Comments

  • ART
    ART almost 2 years

    A PC and embedded Linux device is connected on the same local network.(We don't have DHCP server access, IT admin has the access). We also don't have access to debug UART on the embedded Linux board.

    We do know the MAC-id of the device. So is there any way to get the IP of the device based on the MAC-id?

    Note: PC is running windows 7.

  • ART
    ART over 9 years
    arp -a doesn't show the device, i think it didn't get the IP, we shall get the serial debug connection out and check.
  • ART
    ART over 9 years
    Thank you, i think this is helpful. I will verify this once board gets an IP.
  • ART
    ART over 9 years
    Thank you for reply, i will check and update the status here.
  • ART
    ART almost 8 years
    I know its late to reply this, but just in case, this command shows ip but it doesn't show MAC address
  • ART
    ART almost 8 years
    I was testing this on Ubuntu, If I use sudo it does work.