arp -a – View ARP Cache

What is ARP (Address Resolution Protocol)?

Definition: ARP (Address Resolution Protocol) is a protocol used in IPv4 networks to map (resolve) a device's IP address to its corresponding MAC address on a local network segment.

Purpose: ARP allows devices to communicate at Layer 2 (Ethernet) by discovering the MAC address associated with a given IP address.

Understanding ARP Cache

Definition: The ARP cache is a local memory table that stores mappings of IP addresses to MAC addresses, built from recent ARP traffic.

  • Improves network efficiency by storing address resolutions and avoiding repeated ARP broadcasts for the same device.
  • Speeds up communication by immediately providing the MAC address when sending packets to known IPs.

Using arp -a Command

Platform Command Description
Windows arp -a View ARP cache
Linux/macOS arp -a or ip neigh show View ARP cache
Sample Output:
Interface: 192.168.1.10 --- 0x3
  Internet Address      Physical Address      Type
  192.168.1.1           00-14-22-01-23-45    dynamic
  192.168.1.20          00-25-96-ab-cd-ef    dynamic
  192.168.1.30          00-13-ce-12-34-56    static
      

Interpreting ARP Cache Entries

Field Description
IP Address The device's logical network address
Physical (MAC) Address The hardware address used for Layer 2 communication
Type Dynamic: Learned automatically via ARP requests/replies
Static: Manually configured; remains until manually removed or system restart

Dynamic vs. Static ARP Entries

  • Dynamic Entries: Created automatically when a device communicates with a new IP on the LAN. Automatically removed after a timeout (e.g., 2–10 minutes).
  • Static Entries: Manually added using commands (e.g., arp -s in Windows). Useful for devices that should never change MAC addresses (e.g., servers, routers).
Warning: Manual entries can create connectivity issues if the MAC address changes.

ARP Cache Aging

Timeout: Dynamic entries expire after a period of inactivity.
This ensures the ARP cache does not become stale or filled with outdated entries.

Common Uses of ARP Cache Information

  • Troubleshooting connectivity issues
  • Detecting duplicate IPs or MAC spoofing
  • Verifying network changes (e.g., after replacing a router)

Clearing and Managing ARP Cache

Action Windows Command
Clear all dynamic entries arp -d *
Clear a specific entry arp -d 192.168.1.20

When to clear: After network changes, device replacements, or if the ARP cache contains outdated entries.

Limitations of ARP

Security Vulnerabilities:
ARP is unauthenticated and susceptible to spoofing attacks.
ARP Spoofing: A malicious actor sends fake ARP messages, associating their MAC with another device’s IP (e.g., gateway), allowing them to intercept traffic.

Mitigation Techniques

  • Use Dynamic ARP Inspection (DAI) on managed switches
  • Implement static ARP entries for critical systems
  • Use secure protocols (HTTPS, SSH) to protect sensitive data even if ARP is compromised

Related Networking Concepts

  • Proxy ARP: A router answers ARP requests on behalf of another device, making it appear as if multiple IPs are on the same subnet.
  • Gratuitous ARP: A device broadcasts an ARP reply for its own IP (without a request), often used during IP address changes or failover for faster updates.

Practical Example

Scenario: John cannot access the default gateway (192.168.1.1).
Troubleshooting Steps:
  1. Run arp -a
  2. Check for the entry of 192.168.1.1
  3. If missing, run ping 192.168.1.1 to force ARP resolution
  4. If the MAC address looks wrong or matches multiple IPs, check for spoofing or misconfigurations
  5. If necessary, clear the ARP cache: arp -d * and retest

Exam Tips and Key Points

  • Know how to interpret arp -a output: IP to MAC mapping and type (dynamic/static).
  • Understand ARP cache behavior: why entries age out, how to force or clear entries.
  • Be aware of ARP’s vulnerabilities and basic mitigation.
  • Relate ARP cache to real troubleshooting: device not reachable, duplicate IP, or wrong MAC addresses.
  • Remember: ARP is only used on the local subnet; remote addresses are resolved via the gateway.

A. Sample Scenario: Detecting ARP Spoofing

Situation: John notices intermittent loss of internet access. Network monitoring reveals two different MAC addresses responding for the gateway IP (192.168.1.1).
Steps to Detect ARP Spoofing:
  1. Display the ARP Cache: arp -a
  2. Ping the Gateway Repeatedly, and run arp -a periodically.
  3. If the MAC address for 192.168.1.1 changes between values, it's a sign of ARP spoofing or a network issue.
  4. Investigate further: run arp -a on multiple devices, check for MAC flapping or port security violations on switches.

Mitigation (Best Practices)

  • Enable Dynamic ARP Inspection (DAI) and port security on switches.
  • Use static ARP entries for essential servers/gateways, but do so carefully to avoid operational issues.

B. Adding and Removing Static ARP Entries

Action Command (Windows Example)
Add a static entry arp -s 192.168.1.50 00-aa-bb-cc-dd-ee
Remove a static entry arp -d 192.168.1.50
Important Notes: Static ARP entries are lost after reboot (unless re-applied via script). Use static ARP sparingly—incorrect entries can block access to real devices.

Exam & Real-World Tips

  • Static ARP: Useful for short-term fixes or test labs, but not scalable for large environments.
  • ARP Spoofing Detection: Look for MAC address changes or inconsistencies in arp -a output.
  • Clearing ARP Cache: Run arp -d * to refresh mappings after network changes.

ARP Cache and ARP Command Quiz

1. What is the primary purpose of the ARP protocol?

Correct answer is A. ARP resolves IPv4 addresses to MAC addresses on the local subnet.

2. What does the arp -a command display?

Correct answer is D. arp -a shows the ARP cache with IP and MAC address pairs.

3. What is the difference between dynamic and static ARP entries?

Correct answer is C. Dynamic entries are learned and timeout; static entries are manually set and persist until deleted or reboot.

4. Why would you clear the ARP cache using arp -d *?

Correct answer is B. Clearing the ARP cache helps remove stale or incorrect mappings after device replacements or network changes.

5. What issue might be indicated if two IP addresses map to the same MAC address in the ARP cache?

Correct answer is A. Duplicate MAC for multiple IPs suggests spoofing or address conflicts.

6. How do you add a static ARP entry on Windows?

Correct answer is D. The arp -s command adds a static IP-to-MAC mapping.

7. What happens to dynamic ARP entries after a period of inactivity?

Correct answer is C. Dynamic entries timeout after inactivity to avoid stale entries.

8. Which security risk is ARP particularly vulnerable to?

Correct answer is B. ARP spoofing attacks exploit ARP’s lack of authentication.

9. What technique on managed switches can help mitigate ARP spoofing?

Correct answer is A. Dynamic ARP Inspection validates ARP messages to prevent spoofing.

10. In a scenario where the MAC address of the gateway IP changes frequently in ARP cache, what might this indicate?

Correct answer is D. Changing MAC for the same IP often signals ARP spoofing or conflicts.

← Back to Home