LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ip-neighbor

manages the ARP and NDP neighbor tables

TLDR

Display the neighbor/ARP table
$ ip neighbor
copy
Flush entries for a specific device
$ sudo ip neighbor flush dev [eth0]
copy
Lookup a neighbor entry
$ ip neighbor get [192.168.1.1] dev [eth0]
copy
Add a static ARP entry
$ sudo ip neighbor add [192.168.1.100] lladdr [00:11:22:33:44:55] dev [eth0] nud reachable
copy
Delete an ARP entry
$ sudo ip neighbor delete [192.168.1.100] dev [eth0]
copy
Replace an ARP entry
$ sudo ip neighbor replace [192.168.1.100] lladdr [00:11:22:33:44:55] dev [eth0]
copy

SYNOPSIS

ip neighbor [command] [options]

DESCRIPTION

ip neighbor manages the ARP (IPv4) and NDP (IPv6) neighbor tables. These tables map IP addresses to link-layer (MAC) addresses for hosts on directly connected networks.The neighbor cache is normally populated automatically through ARP/NDP protocols, but static entries can be added for hosts that don't respond to ARP or for security purposes.neighbor is the American spelling accepted by ip; neighbour is the equivalent British spelling, and both refer to the same object. The keyword can also be abbreviated to neigh or n.

PARAMETERS

show [dev DEVICE]

Display neighbor table entries
add IP lladdr MAC dev DEVICE
Add a neighbor entry
delete IP dev DEVICE
Remove a neighbor entry
change IP lladdr MAC dev DEVICE
Modify existing entry
replace IP lladdr MAC dev DEVICE
Add or change entry
flush dev DEVICE
Clear entries for a device
get IP dev DEVICE
Lookup single entry
nud STATE
Neighbor state: permanent, noarp, reachable, stale, none, incomplete, delay, probe, failed.
proxy ADDR
Manage proxy ARP/NDP entries.
to PREFIX
Filter entries by address prefix (used with show/flush).

CAVEATS

Modifying entries requires root privileges. Static entries may become stale if the actual MAC changes. IPv6 uses NDP instead of ARP but is managed through the same interface.

HISTORY

ip neighbor is part of iproute2 and replaces the older arp command from net-tools. It provides unified IPv4 and IPv6 neighbor management.

SEE ALSO

ip(8), ip-neighbour(8), arp(8), arping(8)

RESOURCES

Copied to clipboard
Kai