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