Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Is there a way to ping an IP , and know the PC mac address of this IP ?

For exapmle in my network there is a printer which has the ip (dynamic) , i need to

its mac address to give it a reservation in dhcp .

share|improve this question

marked as duplicate by BuZZ-dEE, guntbert, mikewhatever, Eric Carvalho, Seth Feb 2 '14 at 21:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

If its not on your local network you cant as the traffic will go via your router so the entire internet appears to have the same mac address as your router. However, for your local network you can. – Warren Hill Jan 30 '14 at 8:43
up vote 2 down vote accepted

If the client is in your local network:

  1. ping it.
  2. Then run this command : ip neigh show
share|improve this answer

To do this I first ping the IP. In this example I will use the IP

ping -c 1

Then get the MAC address from the ARP cache:

arp -a | awk '{print $4}'

The output should be the Mac Address

share|improve this answer

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