Linux ARP Command for LAN Cache Inspection

This article provides an overview of the arp command in the Linux operating system, focusing on its role in viewing and managing the local Address Resolution Protocol (ARP) cache. It explains how the ARP cache maps network-layer addresses to link-layer physical addresses, details standard syntax and options for inspecting this table, and highlights its significance in diagnosing local network connectivity issues and security threats.

The Address Resolution Protocol (ARP) bridges the gap between Layer 3 (IPv4 addresses) and Layer 2 (MAC addresses) of the OSI model. When a Linux system communicates with another device on the same local area network (LAN), it requires the target device's physical MAC address. To avoid broadcasting an ARP request for every packet, the kernel stores recent IP-to-MAC translations in memory, known as the ARP cache. The arp command is a dedicated networking utility used to inspect, modify, and manage this cache.

Viewing the ARP Cache

The primary purpose of the arp command is to inspect the current state of the local network mappings. Running the command without flags or with -e displays the active ARP table in standard format:

arp

To display entries in BSD-style format, use the -a option:

arp -a

By default, the command attempts to resolve IP addresses into hostnames via reverse DNS, which can introduce delays. To display purely numerical IP addresses and speed up output, combine it with the -n flag:

arp -n

A typical entry in this table includes:

Cache Management and Manipulation

Beyond passive inspection, the arp utility provides administrative controls to modify entries manually:

Practical Diagnostics and Security

Inspecting the ARP cache serves several critical functions during system administration:

While modern Linux distributions often utilize the newer ip neighbor command from the iproute2 suite, the traditional arp command remains a widely used, foundational tool for rapid LAN troubleshooting and cache verification.