What Is ARP? Reading ip neigh (and arp -a) Step by Step
To send anything to a device on its own network, your computer needs that device's hardware address, its MAC address. It finds them as it goes, and keeps a list. ip neigh shows the list, and it's a quick way to tell whether your computer can even find a device next to it.
Two small home networks joined by a router: a PC and a NAS on one side, a web server and a printer on the other. Every MAC address ends in something easy to read (the PC in 20, the NAS in 30, the router in 01). Open a shell on the PC, read its neighbour table with ip neigh, ping the NAS and watch it join the table, then reach the web server on the other network and see which MAC address your PC actually used to get there.
The lab
The same two home networks as the last two episodes. On the PC's side, every MAC address now ends in something easy to read: the PC in 20, the NAS in 30, and the router in 01.
The neighbour table
ip neigh
10.0.10.1 dev eth1 lladdr 02:00:00:00:00:01 REACHABLE
What this shows
On the PC, ip neigh, short for neighbour. Right now it knows one neighbour: the router, 10.0.10.1, on eth1. lladdr is the link layer address, the MAC, ending 01. And REACHABLE means the PC confirmed it just now.
ping -c 1 10.0.10.30
PING 10.0.10.30 (10.0.10.30) 56(84) bytes of data. 64 bytes from 10.0.10.30: icmp_seq=1 ttl=64 time=0.049 ms --- 10.0.10.30 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.049/0.049/0.049/0.000 ms
What this shows
Now talk to the NAS, once. To send that ping, the PC first had to find the NAS's MAC address. It asked the whole network who has 10.0.10.30, and the NAS answered.
ip neigh
10.0.10.30 dev eth1 lladdr 02:00:00:00:00:30 REACHABLE 10.0.10.1 dev eth1 lladdr 02:00:00:00:00:01 REACHABLE
What this shows
And there it is: 10.0.10.30, MAC ending 30, reachable.
ip link show eth1
1284: eth1@if1283: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
link/ether 02:00:00:00:00:30 brd ff:ff:ff:ff:ff:ff link-netnsid 1What this shows
On the NAS itself, ip link shows its own network card. link ether: the same MAC, ending 30. So the PC's table is right. If those two ever disagreed, something else would be answering for that address, which is exactly what went wrong in the duplicate IP episode.
Only your own network
ping -c 1 10.0.20.80
PING 10.0.20.80 (10.0.20.80) 56(84) bytes of data. 64 bytes from 10.0.20.80: icmp_seq=1 ttl=63 time=0.048 ms --- 10.0.20.80 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.048/0.048/0.048/0.000 ms
What this shows
Now the web server, on the other network, through the router. It answers.
ip neigh
10.0.10.30 dev eth1 lladdr 02:00:00:00:00:30 REACHABLE 10.0.10.1 dev eth1 lladdr 02:00:00:00:00:01 REACHABLE
What this shows
But look at the table. The web server isn't in it. Only the router and the NAS. A MAC address only matters on your own network. For anything beyond it, the PC sends to the router's MAC, and the router takes it from there. So the table only ever shows devices on your own network.
When nobody answers
ping -c 5 10.0.10.99
PING 10.0.10.99 (10.0.10.99) 56(84) bytes of data. From 10.0.10.20 icmp_seq=1 Destination Host Unreachable From 10.0.10.20 icmp_seq=2 Destination Host Unreachable From 10.0.10.20 icmp_seq=3 Destination Host Unreachable From 10.0.10.20 icmp_seq=4 Destination Host Unreachable From 10.0.10.20 icmp_seq=5 Destination Host Unreachable --- 10.0.10.99 ping statistics --- 5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4080ms pipe 3
What this shows
And an address nobody has: 10.0.10.99. The PC asks who has it, and nobody answers, so the pings never leave: destination host unreachable, from the PC itself.
ip neigh
10.0.10.30 dev eth1 lladdr 02:00:00:00:00:30 REACHABLE 10.0.10.1 dev eth1 lladdr 02:00:00:00:00:01 STALE 10.0.10.99 dev eth1 FAILED
What this shows
The whole table now. The NAS, reachable. The router has gone stale in the meantime: still known, and it'll be checked again the next time it's used. And 10.0.10.99, marked FAILED, with no MAC at all: the PC asked, and nobody answered. When a device on your own network won't respond, a FAILED entry tells you your computer can't even find it, so look at the device and its cable first.
Recap
So the neighbour table tells you who your computer has found on its own network. REACHABLE: confirmed just now. STALE, like the router a moment ago: known, and checked again next time it's used. And FAILED: it asked, and nobody answered. Devices on other networks never appear: you reach them through the router.
On Windows and Mac
On Windows and on a Mac, the same table is under its older name, ARP: type arp dash a. Windows writes the MAC addresses with dashes instead of colons. The Learn page on networkincidents.ca has the details.
| Windows | arp -a | the ARP table; MAC addresses written with dashes |
| Mac | arp -a | in Terminal: the same table |
When a device next to you won't answer, ask your computer whether it can even find it: ip neigh, or arp dash a.
Try it yourself
The whole lab runs on your own computer with Docker and containerlab: get it on GitHub, then ./lab.sh up and ./lab.sh break. Setup steps are on Run the labs.