arp Command Examples in Linux

As you know, nodes on the network typically have three identities: hostname, IP addresses, and MAC addresses. DNS translates hostnames to IP addresses. The Address Resolution Protocol (ARP) is used to relate IP addresses and MAC addresses. There is also an arp command that administrators can run to discover information about known MAC addresses.

Computers will cache recently resolved MAC and IP address combinations. If a computer has cached incorrect or out-of-date information, connectivity may be lost to a particular node. The ARP cache can be cleared as part of the troubleshooting process. For example, you can run arp -d {IP address} to a clear entry for a particular IP address, and then try to ping the host again. Use arp -a to view the cache.

Syntax

The syntax of the arp command is:

# arp [options]

arp Command Examples

1. Show the current ARP table:

# arp -a

2. Clear the entire cache:

# arp -a -d

3. Delete a specific entry:

# arp -d address

4. Create an entry in the ARP table:

# arp -s address mac_address
Related Post