Debian Codegraph @

upstream/debian-unstable/man8/ip.8

raw
1 .TH IP 8 "20 Dec 2011" "iproute2" "Linux"
2 .SH NAME
3 ip \- show / manipulate routing, network devices, interfaces and tunnels
4 .SH SYNOPSIS
5
6 .ad l
7 .in +8
8 .ti -8
9 .B ip
10 .RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
11 .BR help " }"
12 .sp
13
14 .ti -8
15 .B ip
16 .RB "[ " -force " ] "
17 .BI "-batch " filename
18 .sp
19
20 .ti -8
21 .IR OBJECT " := { "
22 .BR address " | " addrlabel " | " fou " | " help " | " ila " | " ioam " | "\
23 l2tp " | " link " | " macsec " | " maddress " | " monitor " | " mptcp " | "\
24 mroute " | " mrule " | " neighbor " | " neighbour " | " netconf " | "\
25 netns " | " nexthop " | " ntable " | " ntbl " | " route " | " rule " | "\
26 sr " | " tap " | " tcpmetrics " | " token " | " tunnel " | " tuntap " | "\
27 vrf " | " xfrm " }"
28 .sp
29
30 .ti -8
31 .IR OPTIONS " := { "
32 \fB\-V\fR[\fIersion\fR] |
33 \fB\-h\fR[\fIuman-readable\fR] |
34 \fB\-s\fR[\fItatistics\fR] |
35 \fB\-d\fR[\fIetails\fR] |
36 \fB\-r\fR[\fIesolve\fR] |
37 \fB\-iec\fR |
38 \fB\-f\fR[\fIamily\fR] {
39 .BR inet " | " inet6 " | " link " } | "
40 \fB-4\fR |
41 \fB-6\fR |
42 \fB-B\fR |
43 \fB-0\fR |
44 \fB-l\fR[\fIoops\fR] { \fBmaximum-addr-flush-attempts\fR } |
45 \fB\-o\fR[\fIneline\fR] |
46 \fB\-rc\fR[\fIvbuf\fR] [\fBsize\fR] |
47 \fB\-t\fR[\fIimestamp\fR] |
48 \fB\-ts\fR[\fIhort\fR] |
49 \fB\-n\fR[\fIetns\fR] name |
50 \fB\-N\fR[\fIumeric\fR] |
51 \fB\-a\fR[\fIll\fR] |
52 \fB\-c\fR[\fIolor\fR] |
53 \fB\-br\fR[\fIief\fR] |
54 \fB\-j\fR[son\fR] |
55 \fB\-p\fR[retty\fR] }
56
57 .SH OPTIONS
58
59 .TP
60 .BR "\-V" , " -Version"
61 Print the version of the
62 .B ip
63 utility and exit.
64
65 .TP
66 .BR "\-h", " \-human", " \-human-readable"
67 output statistics with human readable values followed by suffix.
68
69 .TP
70 .BR "\-b", " \-batch " <FILENAME>
71 Read commands from provided file or standard input and invoke them.
72 First failure will cause termination of ip.
73
74 .TP
75 .BR "\-force"
76 Don't terminate ip on errors in batch mode. If there were any errors
77 during execution of the commands, the application return code will be
78 non zero.
79
80 .TP
81 .BR "\-s" , " \-stats" , " \-statistics"
82 Output more information. If the option
83 appears twice or more, the amount of information increases.
84 As a rule, the information is statistics or some time values.
85
86 .TP
87 .BR "\-d" , " \-details"
88 Output more detailed information.
89
90 .TP
91 .BR "\-l" , " \-loops " <COUNT>
92 Specify maximum number of loops the 'ip address flush' logic
93 will attempt before giving up. The default is 10.
94 Zero (0) means loop until all addresses are removed.
95
96 .TP
97 .BR "\-f" , " \-family " <FAMILY>
98 Specifies the protocol family to use. The protocol family identifier
99 can be one of
100 .BR "inet" , " inet6" , " bridge" , " mpls"
101 or
102 .BR link .
103 If this option is not present,
104 the protocol family is guessed from other arguments. If the rest
105 of the command line does not give enough information to guess the
106 family,
107 .B ip
108 falls back to the default one, usually
109 .B inet
110 or
111 .BR "any" .
112 .B link
113 is a special family identifier meaning that no networking protocol
114 is involved.
115
116 .TP
117 .B \-4
118 shortcut for
119 .BR "-family inet" .
120
121 .TP
122 .B \-6
123 shortcut for
124 .BR "\-family inet6" .
125
126 .TP
127 .B \-B
128 shortcut for
129 .BR "\-family bridge" .
130
131 .TP
132 .B \-M
133 shortcut for
134 .BR "\-family mpls" .
135
136 .TP
137 .B \-0
138 shortcut for
139 .BR "\-family link" .
140
141 .TP
142 .BR "\-o" , " \-oneline"
143 output each record on a single line, replacing line feeds
144 with the
145 .B '\e'
146 character. This is convenient when you want to count records
147 with
148 .BR wc (1)
149 or to
150 .BR grep (1)
151 the output.
152
153 .TP
154 .BR "\-r" , " \-resolve"
155 use the system's name resolver to print DNS names instead of
156 host addresses.
157
158 .TP
159 .BR "\-n" , " \-netns " <NETNS>
160 switches
161 .B ip
162 to the specified network namespace
163 .IR NETNS .
164 Actually it just simplifies executing of:
165
166 .B ip netns exec
167 .IR NETNS
168 .B ip
169 .RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
170 .BR help " }"
171
172 to
173
174 .B ip
175 .RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
176 .BR help " }"
177
178 .TP
179 .BR "\-N" , " \-Numeric"
180 Print the number of protocol, scope, dsfield, etc directly instead of
181 converting it to human readable name.
182
183 .TP
184 .BR "\-a" , " \-all"
185 executes specified command over all objects, it depends if command
186 supports this option.
187
188 .TP
189 .BR \-c [ color ][ = { always | auto | never }
190 Configure color output. If parameter is omitted or
191 .BR always ,
192 color output is enabled regardless of stdout state. If parameter is
193 .BR auto ,
194 stdout is checked to be a terminal before enabling color output. If
195 parameter is
196 .BR never ,
197 color output is disabled. If specified multiple times, the last one takes
198 precedence. This flag is ignored if
199 .B \-json
200 is also given.
201
202 Used color palette can be influenced by
203 .BR COLORFGBG
204 environment variable
205 (see
206 .BR ENVIRONMENT ).
207
208 .TP
209 .BR "\-t" , " \-timestamp"
210 display current time when using monitor option.
211
212 .TP
213 .BR "\-ts" , " \-tshort"
214 Like
215 .BR \-timestamp ,
216 but use shorter format.
217
218 .TP
219 .BR "\-rc" , " \-rcvbuf" <SIZE>
220 Set the netlink socket receive buffer size, defaults to 1MB.
221
222 .TP
223 .BR "\-iec"
224 print human readable rates in IEC units (e.g. 1Ki = 1024).
225
226 .TP
227 .BR "\-br" , " \-brief"
228 Print only basic information in a tabular format for better
229 readability. This option is currently only supported by
230 .BR "ip addr show ", " ip link show " & " ip neigh show " commands.
231
232 .TP
233 .BR "\-j", " \-json"
234 Output results in JavaScript Object Notation (JSON).
235
236 .TP
237 .BR "\-p", " \-pretty"
238 The default JSON format is compact and more efficient to parse but
239 hard for most users to read. This flag adds indentation for
240 readability.
241
242 .TP
243 .BR "\-echo"
244 Request the kernel to send the applied configuration back.
245
246 .SH IP - COMMAND SYNTAX
247
248 .SS
249 .I OBJECT
250
251 .TP
252 .B address
253 - protocol (IP or IPv6) address on a device.
254
255 .TP
256 .B addrlabel
257 - label configuration for protocol address selection.
258
259 .TP
260 .B fou
261 - Foo-over-UDP receive port configuration.
262
263 .TP
264 .B ila
265 - manage identifier locator addresses (ILA).
266
267 .TP
268 .B ioam
269 - manage IOAM namespaces and IOAM schemas.
270
271 .TP
272 .B l2tp
273 - tunnel ethernet over IP (L2TPv3).
274
275 .TP
276 .B link
277 - network device.
278
279 .TP
280 .B macsec
281 - MACsec device configuration.
282
283 .TP
284 .B maddress
285 - multicast address.
286
287 .TP
288 .B monitor
289 - watch for netlink messages.
290
291 .TP
292 .B mptcp
293 - manage MPTCP path manager.
294
295 .TP
296 .B mroute
297 - multicast routing cache entry.
298
299 .TP
300 .B mrule
301 - rule in multicast routing policy database.
302
303 .TP
304 .B neighbour
305 - manage ARP or NDISC cache entries.
306
307 .TP
308 .B netconf
309 - network configuration monitoring.
310
311 .TP
312 .B netns
313 - manage network namespaces.
314
315 .TP
316 .B nexthop
317 - manage nexthop objects.
318
319 .TP
320 .B ntable
321 - manage the neighbor cache's operation.
322
323 .TP
324 .B route
325 - routing table entry.
326
327 .TP
328 .B rule
329 - rule in routing policy database.
330
331 .TP
332 .B sr
333 - manage IPv6 segment routing.
334
335 .TP
336 .B stats
337 - manage and show interface statistics.
338
339 .TP
340 .B tcp_metrics/tcpmetrics
341 - manage TCP Metrics.
342
343 .TP
344 .B token
345 - manage tokenized interface identifiers.
346
347 .TP
348 .B tunnel
349 - tunnel over IP.
350
351 .TP
352 .B tuntap
353 - manage TUN/TAP devices.
354
355 .TP
356 .B vrf
357 - manage virtual routing and forwarding devices.
358
359 .TP
360 .B xfrm
361 - manage IPSec policies.
362
363 .PP
364 The names of all objects may be written in full or
365 abbreviated form, for example
366 .B address
367 can be abbreviated as
368 .B addr
369 or just
370 .B a.
371
372 .SS
373 .I COMMAND
374
375 Specifies the action to perform on the object.
376 The set of possible actions depends on the object type.
377 As a rule, it is possible to
378 .BR "add" , " delete"
379 and
380 .B show
381 (or
382 .B list
383 ) objects, but some objects do not allow all of these operations
384 or have some additional commands. The
385 .B help
386 command is available for all objects. It prints
387 out a list of available commands and argument syntax conventions.
388 .sp
389 If no command is given, some default command is assumed.
390 Usually it is
391 .B list
392 or, if the objects of this class cannot be listed,
393 .BR "help" .
394
395 .SH ENVIRONMENT
396 .TP
397 .B COLORFGBG
398 If set, it's value is used for detection whether background is dark or
399 light and use contrast colors for it.
400
401 COLORFGBG environment variable usually contains either two or three
402 values separated by semicolons; we want the last value in either case.
403 If this value is 0-6 or 8, chose colors suitable for dark background:
404
405 COLORFGBG=";0" ip -c a
406
407 .SH EXIT STATUS
408 Exit status is 0 if command was successful, and 1 if there is a syntax error.
409 If an error was reported by the kernel exit status is 2.
410
411 .SH "EXAMPLES"
412 .PP
413 ip addr
414 .RS 4
415 Shows addresses assigned to all network interfaces.
416 .RE
417 .PP
418 ip neigh
419 .RS 4
420 Shows the current neighbour table in kernel.
421 .RE
422 .PP
423 ip link set x up
424 .RS 4
425 Bring up interface x.
426 .RE
427 .PP
428 ip link set x down
429 .RS 4
430 Bring down interface x.
431 .RE
432 .PP
433 ip route
434 .RS 4
435 Show table routes.
436 .RE
437
438 .SH HISTORY
439 .B ip
440 was written by Alexey N. Kuznetsov and added in Linux 2.2.
441 .SH SEE ALSO
442 .BR ip-address (8),
443 .BR ip-addrlabel (8),
444 .BR ip-fou (8),
445 .BR ip-ioam (8),
446 .BR ip-l2tp (8),
447 .BR ip-link (8),
448 .BR ip-macsec (8),
449 .BR ip-maddress (8),
450 .BR ip-monitor (8),
451 .BR ip-mptcp (8),
452 .BR ip-mroute (8),
453 .BR ip-neighbour (8),
454 .BR ip-netconf (8),
455 .BR ip-netns (8),
456 .BR ip-nexthop (8),
457 .BR ip-ntable (8),
458 .BR ip-route (8),
459 .BR ip-rule (8),
460 .BR ip-sr (8),
461 .BR ip-stats (8),
462 .BR ip-tcp_metrics (8),
463 .BR ip-token (8),
464 .BR ip-tunnel (8),
465 .BR ip-vrf (8),
466 .BR ip-xfrm (8)
467 .br
468 .RB "IP Command reference " ip-cref.ps
469 .SH REPORTING BUGS
470 Report any bugs to the Network Developers mailing list
471 .B <[email protected]>
472 where the development and maintenance is primarily done.
473 You do not have to be subscribed to the list to send a message there.
474
475 .SH AUTHOR
476 Original Manpage by Michail Litvak <[email protected]>