arp
arp
The arp
command in Linux is used to manipulate the system's ARP (Address Resolution Protocol) cache. ARP is used to map IP addresses to MAC addresses, which are necessary for network communication within a local network segment. Each time a host needs to communicate with another host on the same network, it uses ARP to find out the MAC address associated with the IP address it wants to communicate with.
Display the ARP Cache:
This command lists all the entries in the ARP cache.
Add a Static ARP Entry:
This command adds a static ARP entry for the IP address
192.168.1.2
with the MAC address00:11:22:33:44:55
.Delete an ARP Entry:
This command deletes the ARP entry for the IP address
192.168.1.2
.
Example of arp
Command Output
arp
Command OutputWhen you run arp -a
, you might see output similar to this:
Using ip
Command for ARP
ip
Command for ARPThe ip
command from the iproute2
package also allows you to manage ARP entries, and it is the modern replacement for the arp
command. Here are equivalent commands using ip
:
Display the ARP Cache:
Add a Static ARP Entry:
Delete an ARP Entry:
Conclusion
While the arp
command is useful for viewing and managing ARP cache entries, it is being replaced by the ip
command for most modern networking tasks. The ip
command provides a more comprehensive and consistent interface for managing networking configuration, including ARP entries. It is recommended to use ip
for advanced and up-to-date network management.
help
breakdown
Last updated