TCP/IP Configuration  «Prev   Next» 

Lesson 10 ARP and RARP
ObjectiveAddress Resolution Protocol and Reverse Address Resolution Protocol

Address Resolution Protocol

The "Address Resolution Protocol (ARP)" is a fundamental protocol used in network administration, including Linux environments, to map "IP addresses to MAC addresses" within a local network. It operates within the "link layer" of the OSI model and is crucial for communication between devices on the same local network.
Purpose of ARP in Linux Network Administration:
  1. Resolving IP to MAC Addresses:
    • When a device wants to communicate with another device on the same local network, it needs to know the MAC address of the destination device. ARP resolves the MAC address corresponding to an IP address.
  2. Maintaining ARP Tables:
    • Linux systems maintain an ARP table (or ARP cache) that stores recently resolved IP-to-MAC address mappings to avoid repeated ARP requests. Network administrators can manage this table to troubleshoot or optimize network performance.
  3. Troubleshooting Network Issues:
    • Tools like arp, ip neigh, or arping in Linux are used to inspect, manipulate, or test ARP resolutions. These are useful for diagnosing connectivity issues within a LAN.
  4. Ensuring Communication in Local Network:
    • ARP is essential for facilitating Layer 2 (Data Link) communication by providing the MAC addresses required for packet delivery over Ethernet or similar technologies.
  5. Handling Proxy ARP:
    • In certain setups, ARP can be configured to act as a proxy, allowing one device to respond to ARP requests for another. This can be useful in advanced network configurations like gateway setups.
  6. Security Implications:
    • Administrators often monitor ARP traffic to detect and mitigate ARP spoofing or poisoning attacks, where a malicious actor manipulates ARP tables to intercept or disrupt network traffic.

Common Linux Commands for ARP:
  • View ARP Table: arp -a or ip neigh show
  • Clear ARP Cache: ip neigh flush all
  • Send ARP Request: arping <IP-address>

By understanding and managing ARP effectively, Linux network administrators can ensure smooth and secure operation of local network communication.

Why ARP is necessary

ARP is necessary because the underlying ethernet hardware communicates using ethernet addresses, not IP addresses. Suppose that one machine, with IP address 2 on an ethernet network, wants to speak to another machine on the same network with IP address 8. The two machines use ARP to conduct the following dialogue:
  1. ARP Request - Machine 1: (IP=2) broadcasts to all machines on the network:
    Question: Who has IP address 8?
  2. ARP Reply - Machine 2 (IP=8) replies: I do.
    The reply of Machine 2 contains its ethernet address, so now Machine 1 knows it.

Machine 1 stashes that address temporarily in a kernel memory area called the ARP cache. That way, if it needs to speak to Machine 2 again soon, it does not have to repeat the ARP request.
  • ARP Spoofing: One common issue that can arise with ARP is ARP spoofing. ARP spoofing is a technique used by malicious actors to intercept network traffic by sending falsified ARP messages. In an ARP spoofing attack, the attacker sends ARP messages with false source MAC addresses, which can cause network traffic to be redirected to the attacker's device. This can be used to steal sensitive information, such as passwords or credit card numbers. To prevent ARP spoofing attacks, network administrators can use techniques such as static ARP entries or ARP spoofing detection software.
  • The (ARP) Address Resolution Protocol feature performs a required function in IP routing. ARP finds the hardware address, also known as (MAC) Media Access Contro address, of a host from its known IP address and maintains a cache (table) in which MAC addresses are mapped to IP addresses. ARP is part of all Cisco systems that run IP. The ARP feature for IP routing and the optional ARP feature you can configure, such as static ARP entries, timeout for dynamic ARP entries, clearing the cache, and proxy ARP are part of its standard feature set.
  • ARP Advice: Sometimes, ARP is the easiest way to find a machine's ethernet address. For example, the Solaris ifconfig command will not tell you a device's ethernet address, but viewing the ARP cache on the machine will show it to you.
  • The ARP Command: The arp command enables you to view the ARP cache, as well as to forcibly add and delete entries. We will experiment with arp in the next exercise, after a brief discussion of the (RARP) Reverse Address Resolution Protocol.

RARP

RARP is used for the opposite purpose; namely, to convert an ethernet address to an IP address. Its purpose is to enable diskless machines, such as X workstations, to find out their IP address at boot time.
Such a machine broadcasts a reverse-ARP request, such as: RARP request— My ethernet address is such and such, what should my IP address be?
Answer: RARP reply— Your IP address is
3ffe:1900:4545:3:200:f8ff:fe21:67cf

The RARP reply must come from an RARP server, which contains a file (/etc/ethers) listing the mapping from ethernet addresses to IP addresses.
ARP Conclusion: In conclusion, the Address Resolution Protocol (ARP) is a protocol used to map a network address to a physical address. It is essential for communication between devices on a network and is used in both IPv4 and IPv6 networks. ARP works by sending out requests for the physical address (MAC address) of a device on the network. Once the MAC address is known, it can be used to communicate with the other device on the network. ARP spoofing is a common issue that can arise with ARP, but there are techniques that can be used to prevent it. By understanding ARP and its role in modern networking, network administrators can help ensure that their networks are secure and efficient.

Address Resolution Protocol - Quiz

Click the Quiz link below to take a short multiple-choice quiz on ARP and RARP.
Address Resolution Protocol - Quiz

SEMrush Software 10 SEMrush Banner 10