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