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