How to Find the MAC Address of a Remote Computer Using ARP in Linux

When troubleshooting local network issues on a Linux server, you often need to look beyond IP addresses. IP addresses are logical and can change via DHCP, but a MAC (Media Access Control) address is the permanent physical identifier hardcoded into every network interface card. If you know a device’s IP address on your local network (LAN) but need its physical MAC address for security filtering, DHCP reservations, or Wake-on-LAN configurations, you can easily find it using the Address Resolution Protocol (ARP) cache in your Linux terminal.

Understanding the ARP Cache

ARP is the protocol that maps IP addresses to physical MAC addresses on a local network segment. When your Linux machine communicates with another device on the same local network, it temporarily stores that device’s MAC address in its internal ARP cache to speed up future communications. By inspecting this cache, you can discover the MAC address of any device you have recently talked to.

Step 1: Ping the Target Device

Before you check the ARP cache, you must ensure your Linux machine has actually communicated with the target device recently. If the device has been silent, it will not appear in the cache.

To force communication, simply ping the target device’s IP address (e.g., 192.168.1.50).

  1. Open your terminal.
  2. Type: ping -c 3 192.168.1.50
  3. Press Enter. The -c 3 flag tells ping to stop after sending 3 packets.

Even if the target device has a firewall that blocks ICMP ping requests and drops the packets, the initial ARP request required to send the ping will usually still populate your cache.

Step 2: Check the ARP Cache

Now that communication has occurred, you can query your system’s ARP table to find the associated MAC address.

Type the following command into your terminal:

arp -a 192.168.1.50

Press Enter.

Understanding the Output

The terminal will output a string of information that looks like this:

? (192.168.1.50) at 00:1A:2B:3C:4D:5E [ether] on eth0

The six pairs of hexadecimal digits separated by colons (00:1A:2B:3C:4D:5E) is the physical MAC address of the remote computer. The output also confirms the network interface (eth0) your Linux machine used to reach that device.

Alternative: The ‘ip neigh’ Command

On modern Linux distributions, the arp command is considered deprecated in favour of the more robust iproute2 suite. You can achieve the exact same result using the ip neighbor command:

ip neigh show 192.168.1.50

This will output a similar line, providing the IP address, the network interface, and the lladdr (link-layer address), which is the MAC address you are looking for.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.