4

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.

6

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
  • Thank you for reply, i will check and update the status here. – AnkurTank Oct 7 '14 at 13:36
  • I know its late to reply this, but just in case, this command shows ip but it doesn't show MAC address – AnkurTank Jul 12 '16 at 14:19
  • I was testing this on Ubuntu, If I use sudo it does work. – AnkurTank Jul 12 '16 at 14:23
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.

  • 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. – AnkurTank Oct 7 '14 at 13:32
  • Thank you, i think this is helpful. I will verify this once board gets an IP. – AnkurTank Oct 7 '14 at 13:35
2

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).

0

It's called address resolution protocol and Wikipedia will tell you all about it =). Quoting from the wiki page,

The Address Resolution Protocol (ARP) is a telecommunication protocol used for resolution of network layer addresses into link layer addresses...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.