]> git.proxmox.com Git - mirror_iproute2.git/blob - man/man8/ip.8
Merge branch 'iproute2-master' into iproute2-next
[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 " | " ipx " | " dnet " | " 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" , " ipx" , " dnet" , " 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 \-D
130 shortcut for
131 .BR "\-family decnet" .
132
133 .TP
134 .B \-I
135 shortcut for
136 .BR "\-family ipx" .
137
138 .TP
139 .B \-M
140 shortcut for
141 .BR "\-family mpls" .
142
143 .TP
144 .B \-0
145 shortcut for
146 .BR "\-family link" .
147
148 .TP
149 .BR "\-o" , " \-oneline"
150 output each record on a single line, replacing line feeds
151 with the
152 .B '\e'
153 character. This is convenient when you want to count records
154 with
155 .BR wc (1)
156 or to
157 .BR grep (1)
158 the output.
159
160 .TP
161 .BR "\-r" , " \-resolve"
162 use the system's name resolver to print DNS names instead of
163 host addresses.
164
165 .TP
166 .BR "\-n" , " \-netns " <NETNS>
167 switches
168 .B ip
169 to the specified network namespace
170 .IR NETNS .
171 Actually it just simplifies executing of:
172
173 .B ip netns exec
174 .IR NETNS
175 .B ip
176 .RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
177 .BR help " }"
178
179 to
180
181 .B ip
182 .RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
183 .BR help " }"
184
185 .TP
186 .BR "\-a" , " \-all"
187 executes specified command over all objects, it depends if command supports this option.
188
189 .TP
190 .BR "\-c" , " -color"
191 Use color output.
192
193 .TP
194 .BR "\-t" , " \-timestamp"
195 display current time when using monitor option.
196
197 .TP
198 .BR "\-ts" , " \-tshort"
199 Like
200 .BR \-timestamp ,
201 but use shorter format.
202
203 .TP
204 .BR "\-rc" , " \-rcvbuf" <SIZE>
205 Set the netlink socket receive buffer size, defaults to 1MB.
206
207 .TP
208 .BR "\-iec"
209 print human readable rates in IEC units (e.g. 1Ki = 1024).
210
211 .TP
212 .BR "\-br" , " \-brief"
213 Print only basic information in a tabular format for better readability. This option is currently only supported by
214 .BR "ip addr show " and " ip link show " commands.
215
216 .TP
217 .BR "\-j", " \-json"
218 Output results in JavaScript Object Notation (JSON).
219
220 .TP
221 .BR "\-p", " \-pretty"
222 The default JSON format is compact and more efficient to parse but hard for most users to read.
223 This flag adds indentation for readability.
224
225 .SH IP - COMMAND SYNTAX
226
227 .SS
228 .I OBJECT
229
230 .TP
231 .B address
232 - protocol (IP or IPv6) address on a device.
233
234 .TP
235 .B addrlabel
236 - label configuration for protocol address selection.
237
238 .TP
239 .B l2tp
240 - tunnel ethernet over IP (L2TPv3).
241
242 .TP
243 .B link
244 - network device.
245
246 .TP
247 .B maddress
248 - multicast address.
249
250 .TP
251 .B monitor
252 - watch for netlink messages.
253
254 .TP
255 .B mroute
256 - multicast routing cache entry.
257
258 .TP
259 .B mrule
260 - rule in multicast routing policy database.
261
262 .TP
263 .B neighbour
264 - manage ARP or NDISC cache entries.
265
266 .TP
267 .B netns
268 - manage network namespaces.
269
270 .TP
271 .B ntable
272 - manage the neighbor cache's operation.
273
274 .TP
275 .B route
276 - routing table entry.
277
278 .TP
279 .B rule
280 - rule in routing policy database.
281
282 .TP
283 .B tcp_metrics/tcpmetrics
284 - manage TCP Metrics
285
286 .TP
287 .B token
288 - manage tokenized interface identifiers.
289
290 .TP
291 .B tunnel
292 - tunnel over IP.
293
294 .TP
295 .B tuntap
296 - manage TUN/TAP devices.
297
298 .TP
299 .B xfrm
300 - manage IPSec policies.
301
302 .PP
303 The names of all objects may be written in full or
304 abbreviated form, for example
305 .B address
306 can be abbreviated as
307 .B addr
308 or just
309 .B a.
310
311 .SS
312 .I COMMAND
313
314 Specifies the action to perform on the object.
315 The set of possible actions depends on the object type.
316 As a rule, it is possible to
317 .BR "add" , " delete"
318 and
319 .B show
320 (or
321 .B list
322 ) objects, but some objects do not allow all of these operations
323 or have some additional commands. The
324 .B help
325 command is available for all objects. It prints
326 out a list of available commands and argument syntax conventions.
327 .sp
328 If no command is given, some default command is assumed.
329 Usually it is
330 .B list
331 or, if the objects of this class cannot be listed,
332 .BR "help" .
333
334 .SH EXIT STATUS
335 Exit status is 0 if command was successful, and 1 if there is a syntax error.
336 If an error was reported by the kernel exit status is 2.
337
338 .SH "EXAMPLES"
339 .PP
340 ip addr
341 .RS 4
342 Shows addresses assigned to all network interfaces.
343 .RE
344 .PP
345 ip neigh
346 .RS 4
347 Shows the current neighbour table in kernel.
348 .RE
349 .PP
350 ip link set x up
351 .RS 4
352 Bring up interface x.
353 .RE
354 .PP
355 ip link set x down
356 .RE
357 .RS 4
358 Bring down interface x.
359 .RE
360 .PP
361 ip route
362 .RS 4
363 Show table routes.
364 .RE
365
366 .SH HISTORY
367 .B ip
368 was written by Alexey N. Kuznetsov and added in Linux 2.2.
369 .SH SEE ALSO
370 .BR ip-address (8),
371 .BR ip-addrlabel (8),
372 .BR ip-l2tp (8),
373 .BR ip-link (8),
374 .BR ip-maddress (8),
375 .BR ip-monitor (8),
376 .BR ip-mroute (8),
377 .BR ip-neighbour (8),
378 .BR ip-netns (8),
379 .BR ip-ntable (8),
380 .BR ip-route (8),
381 .BR ip-rule (8),
382 .BR ip-tcp_metrics (8),
383 .BR ip-token (8),
384 .BR ip-tunnel (8),
385 .BR ip-xfrm (8)
386 .br
387 .RB "IP Command reference " ip-cref.ps
388 .SH REPORTING BUGS
389 Report any bugs to the Network Developers mailing list
390 .B <netdev@vger.kernel.org>
391 where the development and maintenance is primarily done.
392 You do not have to be subscribed to the list to send a message there.
393
394 .SH AUTHOR
395 Original Manpage by Michail Litvak <mci@owl.openwall.com>