blob: 34980c557cc98e0118f37feb2491cc3c775dd510 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001.TH IP\-NEIGHBOUR 8 "20 Dec 2011" "iproute2" "Linux"
2.SH "NAME"
3ip-neighbour \- neighbour/arp tables management.
4.SH "SYNOPSIS"
5.sp
6.ad l
7.in +8
8.ti -8
9.B ip
10.RI "[ " OPTIONS " ]"
11.B neigh
12.RI " { " COMMAND " | "
13.BR help " }"
14.sp
15
16.ti -8
17.BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
18.IR ADDR " [ "
19.B lladdr
20.IR LLADDR " ] [ "
21.BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
22.IR ADDR " } [ "
23.B dev
24.IR DEV " ]"
25
26.ti -8
27.BR "ip neigh" " { " show " | " flush " } [ " proxy " ] [ " to
28.IR PREFIX " ] [ "
29.B dev
30.IR DEV " ] [ "
31.B nud
32.IR STATE " ]"
33
34
35.SH DESCRIPTION
36The
37.B ip neigh
38command manipulates
39.I neighbour
40objects that establish bindings between protocol addresses and
41link layer addresses for hosts sharing the same link.
42Neighbour entries are organized into tables. The IPv4 neighbour table
43is known by another name - the ARP table.
44
45.P
46The corresponding commands display neighbour bindings
47and their properties, add new neighbour entries and delete old ones.
48
49.SS ip neighbour add - add a new neighbour entry
50.SS ip neighbour change - change an existing entry
51.SS ip neighbour replace - add a new entry or change an existing one
52
53These commands create new neighbour records or update existing ones.
54
55.TP
56.BI to " ADDRESS " (default)
57the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
58
59.TP
60.BI dev " NAME"
61the interface to which this neighbour is attached.
62
63.TP
64.BI lladdr " LLADDRESS"
65the link layer address of the neighbour.
66.I LLADDRESS
67can also be
68.BR "null" .
69
70.TP
71.BI nud " NUD_STATE"
72the state of the neighbour entry.
73.B nud
74is an abbreviation for 'Neighbour Unreachability Detection'.
75The state can take one of the following values:
76
77.in +8
78.B permanent
79- the neighbour entry is valid forever and can be only
80be removed administratively.
81.sp
82
83.B noarp
84- the neighbour entry is valid. No attempts to validate
85this entry will be made but it can be removed when its lifetime expires.
86.sp
87
88.B reachable
89- the neighbour entry is valid until the reachability
90timeout expires.
91.sp
92
93.B stale
94- the neighbour entry is valid but suspicious.
95This option to
96.B ip neigh
97does not change the neighbour state if it was valid and the address
98is not changed by this command.
99.in -8
100
101.SS ip neighbour delete - delete a neighbour entry
102This command invalidates a neighbour entry.
103
104.PP
105The arguments are the same as with
106.BR "ip neigh add" ,
107except that
108.B lladdr
109and
110.B nud
111are ignored.
112
113.PP
114.B Warning:
115Attempts to delete or manually change a
116.B noarp
117entry created by the kernel may result in unpredictable behaviour.
118Particularly, the kernel may try to resolve this address even
119on a
120.B NOARP
121interface or if the address is multicast or broadcast.
122
123.SS ip neighbour show - list neighbour entries
124
125This commands displays neighbour tables.
126
127.TP
128.BI to " ADDRESS " (default)
129the prefix selecting the neighbours to list.
130
131.TP
132.BI dev " NAME"
133only list the neighbours attached to this device.
134
135.TP
136.BI proxy
137list neighbour proxies.
138
139.TP
140.B unused
141only list neighbours which are not currently in use.
142
143.TP
144.BI nud " NUD_STATE"
145only list neighbour entries in this state.
146.I NUD_STATE
147takes values listed below or the special value
148.B all
149which means all states. This option may occur more than once.
150If this option is absent,
151.B ip
152lists all entries except for
153.B none
154and
155.BR "noarp" .
156
157.SS ip neighbour flush - flush neighbour entries
158This command flushes neighbour tables, selecting
159entries to flush by some criteria.
160
161.PP
162This command has the same arguments as
163.B show.
164The differences are that it does not run when no arguments are given,
165and that the default neighbour states to be flushed do not include
166.B permanent
167and
168.BR "noarp" .
169
170.PP
171With the
172.B -statistics
173option, the command becomes verbose. It prints out the number of
174deleted neighbours and the number of rounds made to flush the
175neighbour table. If the option is given
176twice,
177.B ip neigh flush
178also dumps all the deleted neighbours.
179
180.SH EXAMPLES
181.PP
182ip neighbour
183.RS
184Shows the current neighbour table in kernel.
185.RE
186.PP
187ip neigh flush dev eth0
188.RS
189Removes entries in the neighbour table on device eth0.
190.RE
191
192.SH SEE ALSO
193.br
194.BR ip (8)
195
196.SH AUTHOR
197Original Manpage by Michail Litvak <mci@owl.openwall.com>