Estimated time: 30 minutes.
Why ARP is needed
Why: RFC 826 defines ARP as the protocol that maps a network layer address (IPv4) to a hardware address (MAC).
An IP is a logical address (L3), a MAC is a physical address (L2); an Ethernet frame requires a destination MAC — ARP fills that gap by sending a broadcast query within the broadcast domain.
Without ARP, the kernel cannot build a valid Ethernet frame even if it knows the destination IP — every packet leaving for the LAN is dropped at L2.
When it breaks: A corrupted ARP cache or a wrong entry → host unreachable even though ping may pass (ICMP takes a different path).
This typically happens after a NIC replacement (new MAC), a VM migration, or an ARP spoof. Symptom: a connection suddenly drops mid-way.
In real deployments: When deploying a new VM in the same subnet: make sure any old ARP entry (from a previous VM that used that IP) has expired or been flushed.
In Kubernetes: when a pod restarts and gets a new IP, the CNI plugin sends a Gratuitous ARP by itself to update the cache across the cluster.
ARP Request = broadcast
Why: RFC 826 §2 specifies that an ARP Request is sent as a broadcast (Ethernet dst=FF:FF:FF:FF:FF:FF) to the whole LAN because the sender does not yet know the destination MAC and cannot unicast.
The ARP packet carries opcode=1 (request), the sender hardware address, the sender protocol address, and the target protocol address — every host reads it to check whether the IP matches.
Cost: every NIC in the broadcast domain must interrupt the CPU to process the frame — which is why the ARP cache matters, to reduce how often broadcasts happen.
When it breaks: A LAN that is too large (/16 = 65534 hosts) with many machines ARPing at once → broadcast storm.
Every machine is constantly interrupted to process ARP → CPU spikes, throughput drops. Solution: split into smaller VLANs (/24 = 254 hosts per segment).
In real deployments: When designing a datacenter: limit the broadcast domain to /24 per VLAN. More than 500 hosts in one subnet = a real risk of significant ARP broadcast overhead.
Keep Kubernetes nodes in the same /24 so ARP works, with L3 routing between /24s.
ARP Reply = unicast
Why: The Request carries the asker's MAC → the target knows to reply straight back without broadcasting again. This saves bandwidth and CPU across the whole LAN.
When it breaks: It does not directly cause errors.
But if the ARP Reply is blocked (some strict firewall policies) → the sender never receives the MAC → keeps sending ARP Requests (ARP retry) → increases broadcast overhead.
In real deployments: Usually nothing needs to be configured.
But in cloud environments with a virtual switch (OVS, Hyper-V vSwitch): you sometimes need to enable ARP proxy or ARP reflection so VMs can communicate.
ARP cache (ip neigh)
Why: RFC 4861 §7.3 describes the neighbor cache state machine that also applies to IPv4 (Linux kernel): an entry moves through INCOMPLETE → REACHABLE (~30s) → STALE → DELAY → PROBE → FAILED.
The REACHABLE time is decided by the kernel based on neighbor reachability confirmation, not a fixed 1–5 minute value.
Seeing STALE in ip neigh is a normal state — the kernel re-verifies when there is traffic; it is not an error.
When it breaks: ARP cache overflow ('neighbor table overflow' in dmesg): the kernel cannot store new entries → ARP fails → host unreachable.
It happens when many different /24s are routed through the same interface or when an attacker runs an ARP scan.
In real deployments: Tuning: net.ipv4.neigh.default.gc_thresh1/2/3 to increase the ARP cache size if you need to route many subnets.
Monitoring: watch -n5 'ip neigh show | wc -l' to detect cache overflow early.
Ping on the same LAN → ARP for the destination IP directly
Why: 192.168.1.10 is in the same subnet → ARP for that IP directly to get its MAC. The frame is sent straight to the destination's MAC. It does not go through the gateway.
When it breaks: A host in the same subnet that does not answer ARP → STALE → FAILED → ping fails with 'Destination Host Unreachable'.
Causes: the host is off, the wrong VLAN, or the host has ARP disabled. Check with: arping -I eth0 192.168.1.10 to debug.
In real deployments: In a Kubernetes pod network: pod A and pod B on the same node → communicate via local ARP (veth pair).
Pod A and C on different nodes → go through the overlay network (VXLAN/Geneve), not direct ARP. Knowing this helps when debugging pod-to-pod latency.
Ping outside the LAN → ARP for the gateway's IP
Why: 8.8.8.8 is in a different subnet → the kernel knows it must go through the gateway (default route). It ARPs for the gateway IP (192.168.1.1) and gets the gateway's MAC.
The frame is sent to the gateway's MAC — NOT the MAC of 8.8.8.8. The gateway strips the original IP, builds a new frame, and keeps routing.
When it breaks: The gateway changes its MAC (device replacement, failover) → stale ARP cache → all outbound traffic goes into a void → the internet fails even though the gateway IP is still correct.
Fix: ip neigh flush dev eth0 to force ARP again. Keepalived uses Gratuitous ARP to avoid this problem.
In real deployments: When a VPS suddenly reports 'no internet': check ip neigh show | grep gateway-IP. If it is FAILED or STALE for a long time → flush and ARP again.
When a cloud provider changes the underlying hardware → the gateway MAC changes → you need to flush the ARP cache.
ARP spoofing
Why: RFC 826 designed ARP without an authentication field — the packet format consists only of the hardware type, protocol type, opcode, and 4 addresses (sender/target hardware + protocol).
Any host on the LAN can send an ARP Reply with arbitrary content; the kernel receives it and updates the cache without checking the origin.
An attacker sends a fake Reply claiming their own MAC for the gateway IP → the victim's cache is poisoned → all outbound traffic goes through the attacker (MITM).
Prevention has to happen at another layer: Dynamic ARP Inspection (DAI) on the switch, end-to-end TLS.
When it breaks: The victim cannot detect it: all traffic still flows (the attacker forwards it on), with slightly higher latency.
Signs: 2 IPs with the same MAC in ip neigh, or sudden latency spikes in the LAN. After the MITM: the attacker reads/modifies unencrypted traffic.
In real deployments: Prevention: Dynamic ARP Inspection (DAI) on a managed switch, use HTTPS/TLS for every service (a MITM cannot read it), and a VPN on untrusted LANs (hotels, cafes).
In the cloud: security groups stop other VMs from spoofing ARP thanks to hypervisor enforcement.
The Linux kernel checks the ARP table (ip neigh) before sending a broadcast. If the cache entry is still valid → it is used right away, with no broadcast.
A cache hit = saves ~1ms and avoids bothering the whole LAN.
When it breaks: An ARP cache entry in FAILED after a flush → ping fails with 'Destination Host Unreachable' even though the host is still alive.
The kernel will retry ARP automatically but with some latency. When debugging 'intermittent connection loss': check the ip neigh state first.
# Show the current ARP cache table
ip neigh show
# Sample output:
# 192.168.1.1 dev eth0 lladdr aa:bb:cc:dd:ee:01 REACHABLE
# 192.168.1.10 dev eth0 lladdr aa:bb:cc:dd:ee:10 STALE
Observe with:
ip neigh show # Show the whole cache with state
ip neigh show nud reachable # Only entries that are reliable
watch -n2 'ip neigh show' # Watch cache changes in real time
When the cache has no MAC for the destination IP,
the host sends an ARP Request as a broadcast (Ethernet dst ff:ff:ff:ff:ff:ff) asking the whole LAN who holds that IP. sudo tcpdump -i eth0 -n arp shows this request as an 'arp who-has' line,
while arping lets you send a request to an IP yourself to see whether a reply comes back.
Seeing a Request with no Reply means the problem is on the target side, not the sender.
When it breaks: No ARP Reply after the Request → the host does not exist, is off, or has ARP disabled (some firewall configs).
To tell them apart: if you see the broadcast Request but no Reply → the problem is on the target side, not the sender.
# Watch ARP broadcasts on the wire with tcpdump
sudo tcpdump -i eth0 -n arp
# Or use arping to send an ARP request manually
sudo arping -I eth0 -c 1 192.168.1.10
Observe with:
sudo tcpdump -i eth0 -n arp # See 'arp who-has' (request) and 'arp reply' (reply)
# Request: Ethernet dst=ff:ff:ff:ff:ff:ff (broadcast)
# Reply: Ethernet dst=<MAC of the asker> (unicast)
sudo arping -I eth0 -c 1 192.168.1.10 # Test ARP manually, see whether there is a reply
Symptoms when it breaks:
The network suddenly slows down and every machine on the LAN is affected even without heavy traffic: dmesg or /var/log/kern.log: 'net_ratelimit:
X callbacks suppressed' together with tcpdump showing hundreds of ARP Requests per second from many different source MACs — a sign of an ARP storm caused by a loop or misconfigured NIC bonding
How to fix:
Identify the source of the storm: count the ARP rate on the switch port or with tcpdump
sudo tcpdump -i eth0 -n arp | awk '{print $NF}' | sort | uniq -c | sort -rn | head -20
Isolate the suspect port on the managed switch to stop the storm
sudo ip link set eth0 down # temporarily isolate the interface that is flooding
The target machine sends a unicast Reply back: 'IP 192.168.1.10 has MAC aa:bb:cc:dd:ee:10'. It is unicast because the Request already supplied the asker's MAC — no broadcast is needed.
The kernel stores it in the cache immediately.
When it breaks: After flushing the cache and a successful ping: ip neigh show must show a new entry with state REACHABLE.
If it is still FAILED after a successful ping → ARP works but something is wrong with the neighbor subsystem (rare, usually a kernel bug or container network misconfiguration).
# Watch the cache being updated after a ping
ip neigh flush all # Clear the cache
ping -c 1 192.168.1.10 # Trigger ARP
ip neigh show # See the newly added entry
Observe with:
ip neigh flush all && ping -c 1 192.168.1.10 && ip neigh show
# After this command: you see the entry 192.168.1.10 REACHABLE with the correct MAC
# Timing: ARP resolution happens in <1ms when the host is alive
When you ping an address outside the subnet such as 8.8.8.8, the kernel does not ARP for that IP itself but consults the routing table to get the next hop.
With default via 192.168.1.1, an ARP Request is sent to ask for the gateway's MAC, and the frame carrying the ping packet is sent to that MAC.
Running tcpdump alongside the ping shows a request asking for the gateway IP, not 8.8.8.8.
When it breaks: ip neigh flush + ping 8.8.8.8: tcpdump must show an ARP request for 192.168.1.1, not 8.8.8.8.
If you do not see an ARP for the gateway → the routing table is wrong (no default route) → 'Network unreachable' instead of an ARP timeout.
# Look at the routing table to understand how the kernel decides the next hop
ip route
# Output: default via 192.168.1.1 dev eth0
# When pinging 8.8.8.8 → ARP happens for 192.168.1.1
sudo tcpdump -i eth0 arp &
ping -c 1 8.8.8.8
kill %1
Observe with:
ip route # Look for 'default via X.X.X.X' — this is the IP that gets ARPed
sudo tcpdump -i eth0 arp -n # Capture alongside while pinging 8.8.8.8
# Confirm: the ARP request asks for the gateway IP, not 8.8.8.8
ARP has no authentication mechanism: any machine can send a Reply claiming to own an IP, and other hosts may update their cache accordingly.
An attacker exploits this to poison the cache and make traffic flow through their machine (MITM).
An easy sign to spot is two different IPs in the cache pointing to the same MAC — detect it with ip neigh show | awk '{print $5}' | sort | uniq -d or arp-scan --localnet.
When it breaks: ARP does not authenticate the sender — any machine can claim any IP. This is a by-design weakness of RFC 826.
You cannot 'patch' ARP — you must defend at another layer (switch DAI, VPN, TLS).
# Detect ARP spoofing with arp-scan or by looking for anomalies
# (on Linux - for learning only, do NOT use for real attacks)
arp -a | sort -t'.' -k4 -n # View the whole cache, look for duplicate MACs
# Detection: 2 IPs with the same MAC = a sign of spoofing
# ip neigh | awk '{print $5}' | sort | uniq -d
Observe with:
ip neigh show | awk '{print $5}' | sort | uniq -d # Find duplicate MACs
# If there is output → 2 IPs share 1 MAC → a sign of spoofing or NIC bonding
arp-scan --localnet # Scan ARP across the whole LAN, compare MACs with what you expect
Symptoms when it breaks:
Traffic to the gateway is lost or goes the wrong way, and LAN latency jumps by ~2-5ms: ip neigh show | awk '/192.168.1.1/{print}' returns a MAC that does not match the gateway's real MAC —
for example: '192.168.1.1 dev eth0 lladdr de:ad:be:ef:00:01 REACHABLE' while the gateway's real MAC is aa:bb:cc:dd:ee:01
How to fix:
Confirm the gateway's real MAC by asking the switch directly or comparing against a baseline
sudo arping -I eth0 -c 2 192.168.1.1 | grep 'reply from'
Delete the poisoned ARP cache entry and force a re-resolve
sudo ip neigh del 192.168.1.1 dev eth0 && ping -c 1 192.168.1.1
Add a static ARP entry for the gateway to block further spoofing (temporary)
sudo ip neigh add 192.168.1.1 lladdr aa:bb:cc:dd:ee:01 dev eth0 nud permanent
Scripting it: Cron: */5 * * * * /usr/local/bin/arp-monitor.sh eth0. Requires the arp-scan package. Log to syslog for centralized alerting.
#!/bin/bash
# Detect duplicate MACs (an ARP spoofing indicator) on the LAN
# Uses arp-scan, run from cron every 5 minutes
INTERFACE=${1:-eth0}
DUPS=$(sudo arp-scan --interface="$INTERFACE" --localnet 2>/dev/null \
| awk '/DUP/{print $1, $2}' | sort -u)
if [ -n "$DUPS" ]; then
echo "[ALERT $(date '+%Y-%m-%d %H:%M:%S')] Duplicate MAC detected on $INTERFACE:"
echo "$DUPS"
logger -t arp-monitor "ALERT: duplicate MAC — $DUPS"
fi
Hands-on capture is the only way to truly see ARP at work. The Wireshark filter 'arp' isolates it completely. What to observe: Dst broadcast → Request; Dst unicast → Reply.
This is core knowledge when debugging 'host unreachable'.
When it breaks: Running tcpdump on the wrong interface (vlan vs physical, docker0 vs eth0) → you see no ARP even though it is happening.
In Docker/Kubernetes: ARP happens on virtual interfaces (veth, docker0, cni0), not eth0.
# Terminal 1: Capture ARP
sudo tcpdump -i eth0 -n -vvv arp
# Terminal 2: Flush the cache and then ping to trigger ARP
ip neigh flush all
ping -c 1 192.168.1.10
# Wireshark filter: arp
# Look for: Who has 192.168.1.10? Tell 192.168.1.5
Observe with:
sudo tcpdump -i eth0 -n -vvv arp # -vvv to see the full ARP fields
# Read: 'arp who-has TARGET tell SENDER' = Request
# Read: 'arp reply TARGET is-at MAC' = Reply
ip link show # List all interfaces — pick the right interface
When an interface comes up, Linux sends a Gratuitous ARP by itself: a broadcast '192.168.1.5 has MAC ...'.
Purpose: (1) update every machine's cache with the new MAC, (2) detect an IP conflict — if anyone replies, two machines share the same IP.
This is also the mechanism used for VIP failover (VRRP/keepalived).
When it breaks: After a keepalived failover with no Gratuitous ARP sent → hosts on the LAN keep the old cache (the primary node's MAC) → traffic to the VIP still goes to the node that is down → downtime lasts until the cache expires (~5 minutes).
Gratuitous ARP is a mandatory step in failover.
# Send a Gratuitous ARP manually (for example after a failover)
arping -A -I eth0 -c 3 192.168.1.5
# Or use arping to check for an IP conflict:
arping -D -I eth0 192.168.1.5
# Exit code 1 = conflict
Observe with:
sudo tcpdump -i eth0 arp # See the Gratuitous ARP when running arping -A
# Gratuitous: sender IP = target IP (the host asks about its own address)
arping -D -I eth0 192.168.1.5 # Duplicate Address Detection: exit 1 = conflict
Wrong: An ARP Request is sent unicast directly to the destination IP
Right: An ARP Request is a broadcast (Ethernet dst=FF:FF:FF:FF:FF:FF) sent to the entire broadcast domain; only the host whose IP matches sends a unicast Reply back.
See RFC 826 §2.
Getting this wrong makes you unable to debug 'no ARP reply' — if VLAN isolation is wrong or the broadcast domain is split, the ARP Request never reaches the target even though IP routing is fine.
Check with tcpdump -n arp to see the actual broadcast frame.
Wrong: When you ping 8.8.8.8, the operating system sends an ARP Request for 8.8.8.8
Right: The kernel consults the routing table to determine the next hop; if 8.8.8.8 is outside the subnet, ARP is sent for the default gateway's IP, not 8.8.8.8.
RFC 826 confines ARP to the broadcast domain — IPs outside the subnet have no ARP entry.
Getting this wrong leads to debugging the firewall at the wrong layer: seeing 'no ARP for 8.8.8.8' and assuming a routing fault, when in fact the gateway ARP is what is failing.
Use ip neigh show | grep gateway-IP to pin it down correctly.
Wrong: The ARP cache keeps an entry forever until a reboot
Right: The Linux neighbor cache follows the state machine of RFC 4861 §7.3: REACHABLE (~30s) → STALE → DELAY → PROBE → FAILED; the kernel expires and re-verifies entries by itself when needed.
A STALE entry is normal — there is no need to flush manually.
Not knowing that STALE is a normal state leads to flushing the ARP cache needlessly, which causes a small broadcast storm on a large LAN.
Only flush when an entry is FAILED and you need to force a re-resolve.
Wrong: There is only one kind of ARP message (Request)
Right: ARP has 2 opcodes: Request (opcode=1) and Reply (opcode=2) per RFC 826 §3.
There is also Gratuitous ARP — a host sends an ARP Request or Reply asking or answering for its own IP to update caches and detect IP conflicts, defined in RFC 5227 §2.
Not distinguishing Gratuitous ARP leads to misreading tcpdump when debugging a failover: seeing an ARP Reply with no preceding Request is normal in a VRRP/keepalived failover — it is not ARP spoofing.
Wrong: ARP works across routers and resolves IPs in any subnet
Right: ARP is an L2 protocol, and broadcasts do not cross routers (RFC 826).
Each subnet has its own ARP broadcast domain; a router forwards packets by IP routing and does not use ARP across subnets. Proxy ARP is a special feature that a router opts into, not the default.
Getting this wrong leads to a bad VPC design: creating a /16 subnet for the whole datacenter and expecting ARP to resolve across racks — in reality you need L3 routing between /24s.
Kubernetes nodes also need to be in the same broadcast domain for ARP to work.
1. Observe ARP Request/Reply directly on the wire — see the broadcast and the unicast with your own eyes
# Flush the cache first to make sure there is a fresh ARP exchange
sudo ip neigh flush all
# Capture ARP in terminal 1
sudo tcpdump -i eth0 -n -vvv arp
# In terminal 2: ping to trigger it
ping -c 1 192.168.1.1
Observation: # Request: Ethernet dst=ff:ff:ff:ff:ff:ff (broadcast) # 'arp who-has 192.168.1.1 tell 192.168.1.5' # Reply: Ethernet dst=<MAC requester> (unicast) # 'arp reply 192.168.1.1 is-at aa:bb:cc:dd:ee:01'
2. View the ARP cache and understand the REACHABLE/STALE states — the basis for debugging 'host unreachable'
# View the full cache with state
ip neigh show
# View only the REACHABLE entries
ip neigh show nud reachable
# Delete one specific entry
sudo ip neigh del 192.168.1.10 dev eth0
Observation: # State lifecycle: REACHABLE → STALE (idle) → FAILED (ARP gets no reply)
3. Check for an IP conflict with Gratuitous ARP — important when adding a new IP or after a failover
# -D = Duplicate Address Detection mode
# Exit code 1 = conflict
arping -D -I eth0 -c 2 192.168.1.5
echo "Exit: $?" # 0=OK, 1=conflict
Observation: # If exit is 1: another machine replied to the Gratuitous ARP → the IP is already in use
4. See the ARP path when pinging the Internet — confirm that 'the frame uses the gateway's MAC, not the destination's MAC'
# Look at the routing table — read the default via line to find the gateway
ip route
# Flush the cache, ping 8.8.8.8, see which IP ARP happens for
sudo ip neigh flush all
sudo tcpdump -i eth0 arp -n &
ping -c 1 8.8.8.8
sleep 1 && kill %1
ip neigh show # Only the gateway IP shows up, not 8.8.8.8
Observation: # ip neigh show after pinging 8.8.8.8: only an entry for 192.168.1.1 (the gateway)
5. Detect signs of ARP spoofing on the network — a necessary skill for security and auditing
# Find 2 IPs with the same MAC address (a sign of spoofing)
ip neigh show | awk '{print $5}' | sort | uniq -d
# Scan ARP across the whole LAN and compare
sudo arp-scan --localnet 2>/dev/null | awk '/([0-9a-f]{2}:){5}/' | sort -t$'\t' -k2
# If a MAC matches 2+ IPs → investigate immediately
Observation: # Output of ip neigh: column 5 is the MAC address
Question 1. A computer knows the destination IP 192.168.1.10. Why does it still need ARP before sending the frame?
To check whether the host is still alive
An Ethernet frame needs a destination MAC; you cannot put an IP in the MAC field
ARP helps find the routing path
To encrypt the data before sending
Answer: An Ethernet frame needs a destination MAC; you cannot put an IP in the MAC field. The Ethernet frame header has a Destination MAC field — it must be a 6-byte MAC.
There is no syntax for putting an IP there. ARP is the mandatory step to obtain the MAC from the IP before framing.
To check whether the host is still alive: Checking whether a host is alive is the job of ICMP ping (L3), not ARP (L2).
ARP helps find the routing path: Routing is the job of IP (L3) and the routing table. ARP only works within one LAN and does not route.
To encrypt the data before sending: Encryption belongs to TLS/L4-L6 and is completely unrelated to ARP.
Question 2. You ping 8.8.8.8 from host 192.168.1.5. Which IP's MAC will the ARP request ask for?
8.8.8.8 — the destination IP being pinged
192.168.1.5 — the sending host's IP
192.168.1.1 — the IP of the default gateway
There is no ARP because 8.8.8.8 is on the Internet
Answer: 192.168.1.1 — the IP of the default gateway. 8.8.8.8 is not in the same subnet → the kernel consults the routing table → the next hop is the default gateway 192.168.1.1.
The frame must reach the gateway first → ARP asks for the MAC of 192.168.1.1, not 8.8.8.8. The MAC of 8.8.8.8 does not exist on this LAN.
8.8.8.8 — the destination IP being pinged: 8.8.8.8 is on a different network — ARP only works within the same broadcast domain (LAN). You cannot ARP across a router.
192.168.1.5 — the sending host's IP: ARPing for the sending host itself is meaningless. Gratuitous ARP is different — it is sent to announce, not to ask.
There is no ARP because 8.8.8.8 is on the Internet: Wrong — ARP still happens, but for the gateway IP. Without ARP no frame could go out at all.
Question 3. Which Ethernet address is an ARP Request sent to?
The gateway's MAC
The destination IP's MAC (using the old table)
FF:FF:FF:FF:FF:FF (broadcast)
The multicast address 01:00:5E:...
Answer: FF:FF:FF:FF:FF:FF (broadcast). An ARP Request is a broadcast because the destination MAC is not known yet — that is exactly why it has to ask.
FF:FF:FF:FF:FF:FF is the Ethernet broadcast address, which every machine on the LAN receives and reads.
The gateway's MAC: If you already knew the gateway's MAC you would not need ARP at all — this is circular reasoning.
The destination IP's MAC (using the old table): If you already had an old MAC table you would not need an ARP request — you would just use the cache.
The multicast address 01:00:5E:...: The multicast range 01:00:5E is used for IGMP/mDNS, not ARP.
Question 4. How is an ARP Reply sent?
Broadcast — so every machine updates its cache
Unicast — straight back to the machine that sent the Request
Multicast — to save bandwidth
Sent through a router to the asker
Answer: Unicast — straight back to the machine that sent the Request. The ARP Request carries the asker's MAC in the Sender MAC field. The target reads it → sends a unicast Reply to that MAC.
There is no need to broadcast again — it saves CPU on every machine on the LAN.
Broadcast — so every machine updates its cache: A broadcast Reply is costly — every machine has to process it. ARP is designed to use unicast because the asker's address is already known.
Multicast — to save bandwidth: ARP does not use multicast. Multicast requires groups to be registered in advance.
Sent through a router to the asker: ARP is an L2 protocol and does not pass through a router. A router is an L3 device, and ARP stays within one LAN.
Question 5. An attacker on the same LAN sends a fake ARP Reply: 'IP 192.168.1.1 has MAC=attacker_mac'. What is the consequence?
None — the victim will verify by asking again
The victim stores the wrong MAC in its cache → traffic to the gateway goes through the attacker (MITM)
The switch detects and blocks the fake frame
The router rejects frames with the wrong MAC
Answer: The victim stores the wrong MAC in its cache → traffic to the gateway goes through the attacker (MITM).
ARP has no authentication mechanism — the machine receiving the Reply trusts it and updates its cache immediately, even if it never sent a Request (gratuitous ARP).
The victim sends traffic to attacker_mac instead of the gateway → the attacker forwards it on to avoid detection, and reads/modifies the content.
None — the victim will verify by asking again: ARP has no verification mechanism — this is a by-design weakness. RFC 826 has no authentication.
The switch detects and blocks the fake frame: An ordinary (unmanaged) switch does not inspect ARP. Only a managed switch with Dynamic ARP Inspection (DAI) will block it.
The router rejects frames with the wrong MAC: A router only handles L3 (IP). A frame enters the router based on the MAC — if the MAC is the router's own, the router accepts it as normal.
Question 6. Which command shows the ARP cache on modern Linux?
arp -a
ip neigh show
netstat -r
route -n
Answer: ip neigh show. ip neigh show is the modern command (iproute2); it shows the neighbor table (ARP cache) with state (REACHABLE/STALE/FAILED). arp -a also works but is legacy (net-tools) and gives less information.
arp -a: arp -a works but is an old (deprecated) command. On many newer distros net-tools is not installed by default.
netstat -r: netstat -r shows the routing table (L3), not the ARP cache (L2).
route -n: route -n is also the routing table and is unrelated to ARP.
Question 7. After ip neigh flush all, pinging 192.168.1.10 succeeds. What happens with ARP?
Ping uses the IP directly, so ARP is not needed
ARP Request broadcast → Reply from 192.168.1.10 → the cache is populated → ICMP can be sent
Ping fails because the cache is empty
The kernel fills in the MAC from the routing table by itself
Answer: ARP Request broadcast → Reply from 192.168.1.10 → the cache is populated → ICMP can be sent. With an empty cache → the kernel sends an ARP Request broadcast.
192.168.1.10 replies with its MAC. The kernel stores it in the cache. Only then can the ICMP Echo Request be sent in an Ethernet frame with the correct MAC. The whole thing happens within a few ms.
Ping uses the IP directly, so ARP is not needed: ICMP (ping) runs on IP (L3), but to go onto the wire it must be encapsulated in an L2 frame — and the frame needs a destination MAC.
ARP cannot be skipped.
Ping fails because the cache is empty: Ping will succeed once ARP completes — it does not fail.
The kernel fills in the MAC from the routing table by itself: The routing table holds the next-hop IP, not a MAC. The MAC has to be obtained via ARP.
What is ARP and what problem does it solve?
Address Resolution Protocol — maps an IP (L3) to a MAC (L2). It solves the problem that an Ethernet frame needs a destination MAC but the app only knows the IP.
*This is the mandatory bridge between L2 and L3. Without ARP you cannot send a frame even if you know the IP — understanding this helps you debug 'host unreachable' faster. *
Which address is an ARP Request sent to? Why?
The Ethernet broadcast FF:FF:FF:FF:FF:FF. Because the destination MAC is not known yet — it has to ask every machine on the LAN.
*A broadcast costs the CPU of every machine on the LAN → that is why the ARP cache matters. Understanding this helps explain why a large LAN (many machines) is prone to broadcast storms. *
Is an ARP Reply sent unicast or broadcast?
Unicast — straight to the MAC of the machine that sent the Request (taken from the Sender MAC field in the Request).
*An optimal design: it already has enough information to unicast, without bothering the whole LAN. Understand this point so you do not confuse it with 'ARP is always broadcast'. *
Pinging 8.8.8.8 from 192.168.1.5: which IP's MAC does ARP ask for?
The MAC of 192.168.1.1 (the default gateway) — not 8.8.8.8. 8.8.8.8 is in a different subnet → it has to go through the gateway. *The point devs get wrong most often.
A frame can only travel within one LAN — the destination MAC is always the next hop (the gateway), not the final destination IP. Important when debugging MITM and routing. *
What is the ARP cache lifetime on Linux? What are the states?
Typically 60s (REACHABLE) → 1 more minute (STALE) → FAILED. View with ip neigh show. Flush with ip neigh flush all. *When the cache expires → ARP again → takes time.
In production, cache flapping (the MAC changing constantly) usually signals ARP spoofing or a failover. *
How does ARP spoofing work?
The attacker sends a fake ARP Reply (without being asked first): 'IP_victim/gateway has MAC=attacker_mac'. The victim believes it → the cache is poisoned → MITM.
*ARP has no authentication — a by-design weakness of RFC 826.
Know this to understand why you need DAI on the switch and why you should not trust unfamiliar LANs (hotels, cafes). *
What is Gratuitous ARP? When is it used?
An ARP Request/Reply where sender IP = target IP (the host announces its own IP). Used for: (1) announcing a new MAC after a failover, (2) detecting IP conflicts, (3) VRRP/keepalived.
*Keepalived/VRRP sends a Gratuitous ARP when the VIP moves to the backup node — every machine updates its cache with the new MAC.
Without Gratuitous ARP, traffic is blackholed for ~5 minutes until the old cache expires. *
What is Dynamic ARP Inspection (DAI)?
A feature on managed switches: it checks whether ARP packets are valid (against the DHCP snooping table). An untrusted port that sends a fake ARP Reply → the switch blocks it.
*DAI is an L2 defense against ARP spoofing — no host changes needed. Important in datacenter and enterprise environments. If you only have an unmanaged switch → use a VPN. *
Why is a LAN with 1000 machines prone to an ARP broadcast storm?
Each ARP Request = a broadcast to 999 other machines. If many machines ARP at once → every host's CPU has to process thousands of broadcasts per second.
*This is why VLANs were invented: to split a large LAN into several small broadcast domains. /24 = 254 hosts; /22 = 1022 hosts — scaling linearly with the number of hosts. *
ip neigh show — what are the states?
REACHABLE: recently used, trustworthy. STALE: not used for a while, may be outdated. FAILED: ARP failed. PERMANENT: hard-configured, never expires.
*STALE does not mean wrong — when a frame needs to be sent, the kernel probes again. FAILED = host unreachable. Debugging 'neighbor table overflow' applies when there are too many unfamiliar /24 IPs.
What is Proxy ARP?
A router answers ARP on behalf of a host on another network, supplying the router's own MAC. The host thinks the target is on the same LAN, but in reality it goes through the router.
*Used in some VPNs and legacy networks. Downside: it hides the network boundary and is hard to debug. On Linux: net.ipv4.conf.eth0.proxy_arp=1. *