← 返回命令列表

Linux command

ip-neighbour 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Example

ip neighbour

Flush

sudo ip neighbour flush dev [eth0]

Lookup

ip neighbour get [192.168.1.1] dev [eth0]

Add

sudo ip neighbour add [192.168.1.100] lladdr [00:11:22:33:44:55] dev [eth0] nud reachable

Delete

sudo ip neighbour delete [192.168.1.100] dev [eth0]

Replace

sudo ip neighbour replace [192.168.1.100] lladdr [00:11:22:33:44:55] dev [eth0]

说明

ip neighbour manages the ARP (IPv4) and NDP (IPv6) neighbour tables. These tables map IP addresses to link-layer (MAC) addresses for hosts on directly connected networks. The neighbour 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.

参数

show dev _DEVICE_
Display neighbour table entries
add _IP_ lladdr _MAC_ dev _DEVICE_
Add a neighbour entry
delete _IP_ dev _DEVICE_
Remove a neighbour 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_
Neighbour 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).

FAQ

What is the ip-neighbour command used for?

ip neighbour manages the ARP (IPv4) and NDP (IPv6) neighbour tables. These tables map IP addresses to link-layer (MAC) addresses for hosts on directly connected networks. The neighbour 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.

How do I run a basic ip-neighbour example?

Run `ip neighbour` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does show dev _DEVICE_ do in ip-neighbour?

Display neighbour table entries