]>
Commit | Line | Data |
---|---|---|
2a9721f1 | 1 | .TH IP 8 "20 Dec 2011" "iproute2" "Linux" |
985794ad | 2 | .SH NAME |
be78fade | 3 | ip \- 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 PŠ |
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 | 61 | Print the version of the |
985794ad SH |
62 | .B ip |
63 | utility and exit. | |
64 | ||
9b2e9f4a PS |
65 | .TP |
66 | .BR "\-h", " \-human", " \-human-readable" | |
67 | output statistics with human readable values followed by suffix. | |
68 | ||
09154ec1 SH |
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" | |
f76ad635 SH |
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. | |
09154ec1 | 79 | |
985794ad | 80 | .TP |
49572501 | 81 | .BR "\-s" , " \-stats" , " \-statistics" |
a89d5329 | 82 | Output more information. If the option |
985794ad SH |
83 | appears twice or more, the amount of information increases. |
84 | As a rule, the information is statistics or some time values. | |
85 | ||
a5eafa9a | 86 | .TP |
87 | .BR "\-d" , " \-details" | |
88 | Output more detailed information. | |
89 | ||
64c79560 | 90 | .TP |
49572501 | 91 | .BR "\-l" , " \-loops " <COUNT> |
142434dc | 92 | Specify maximum number of loops the 'ip address flush' logic |
a89d5329 | 93 | will attempt before giving up. The default is 10. |
64c79560 BG |
94 | Zero (0) means loop until all addresses are removed. |
95 | ||
985794ad | 96 | .TP |
49572501 | 97 | .BR "\-f" , " \-family " <FAMILY> |
f76ad635 SH |
98 | Specifies the protocol family to use. The protocol family identifier |
99 | can be one of | |
738aebe5 | 100 | .BR "inet" , " inet6" , " bridge" , " mpls" |
985794ad | 101 | or |
49572501 KR |
102 | .BR link . |
103 | If this option is not present, | |
a89d5329 | 104 | the protocol family is guessed from other arguments. If the rest |
985794ad SH |
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 | ||
27bca615 SH |
126 | .TP |
127 | .B \-B | |
128 | shortcut for | |
129 | .BR "\-family bridge" . | |
130 | ||
dacc5d41 EB |
131 | .TP |
132 | .B \-M | |
133 | shortcut for | |
134 | .BR "\-family mpls" . | |
135 | ||
985794ad SH |
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 | |
1b3c149b | 145 | .B '\e' |
ae9b671d | 146 | character. This is convenient when you want to count records |
985794ad SH |
147 | with |
148 | .BR wc (1) | |
1b3c149b | 149 | or to |
985794ad SH |
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 | ||
52700d40 | 158 | .TP |
142434dc | 159 | .BR "\-n" , " \-netns " <NETNS> |
52700d40 VK |
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 | ||
ca697cee HL |
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 | ||
b13ba03f VK |
183 | .TP |
184 | .BR "\-a" , " \-all" | |
f76ad635 SH |
185 | executes specified command over all objects, it depends if command |
186 | supports this option. | |
b13ba03f | 187 | |
d7bd2db5 | 188 | .TP |
ff1ab8ed PS |
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 , | |
f76ad635 SH |
194 | stdout is checked to be a terminal before enabling color output. If |
195 | parameter is | |
ff1ab8ed PS |
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. | |
d7bd2db5 | 201 | |
8b5f9338 PV |
202 | Used color palette can be influenced by |
203 | .BR COLORFGBG | |
204 | environment variable | |
205 | (see | |
206 | .BR ENVIRONMENT ). | |
207 | ||
25bc3d3d SA |
208 | .TP |
209 | .BR "\-t" , " \-timestamp" | |
210 | display current time when using monitor option. | |
211 | ||
ac0eff58 PS |
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 | ||
134080cf PS |
222 | .TP |
223 | .BR "\-iec" | |
224 | print human readable rates in IEC units (e.g. 1Ki = 1024). | |
225 | ||
6a78ef97 | 226 | .TP |
bff0f252 | 227 | .BR "\-br" , " \-brief" |
f76ad635 SH |
228 | Print only basic information in a tabular format for better |
229 | readability. 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" | |
234 | Output results in JavaScript Object Notation (JSON). | |
235 | ||
236 | .TP | |
237 | .BR "\-p", " \-pretty" | |
f76ad635 SH |
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. | |
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 | |
328 | The names of all objects may be written in full or | |
ce743da1 | 329 | abbreviated form, for example |
985794ad | 330 | .B address |
49572501 | 331 | can be abbreviated as |
985794ad SH |
332 | .B addr |
333 | or just | |
334 | .B a. | |
335 | ||
336 | .SS | |
337 | .I COMMAND | |
338 | ||
339 | Specifies the action to perform on the object. | |
340 | The set of possible actions depends on the object type. | |
341 | As a rule, it is possible to | |
342 | .BR "add" , " delete" | |
343 | and | |
344 | .B show | |
345 | (or | |
346 | .B list | |
347 | ) objects, but some objects do not allow all of these operations | |
a89d5329 | 348 | or have some additional commands. The |
985794ad | 349 | .B help |
a89d5329 | 350 | command is available for all objects. It prints |
985794ad SH |
351 | out a list of available commands and argument syntax conventions. |
352 | .sp | |
353 | If no command is given, some default command is assumed. | |
354 | Usually it is | |
355 | .B list | |
356 | or, 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 |
362 | If set, it's value is used for detection whether background is dark or |
363 | light and use contrast colors for it. | |
8b5f9338 PV |
364 | |
365 | COLORFGBG environment variable usually contains either two or three | |
366 | values separated by semicolons; we want the last value in either case. | |
367 | If this value is 0-6 or 8, chose colors suitable for dark background: | |
368 | ||
369 | COLORFGBG=";0" ip -c a | |
370 | ||
ce743da1 SH |
371 | .SH EXIT STATUS |
372 | Exit status is 0 if command was successful, and 1 if there is a syntax error. | |
373 | If an error was reported by the kernel exit status is 2. | |
374 | ||
0db70c59 AA |
375 | .SH "EXAMPLES" |
376 | .PP | |
377 | ip addr | |
378 | .RS 4 | |
379 | Shows addresses assigned to all network interfaces. | |
380 | .RE | |
381 | .PP | |
382 | ip neigh | |
383 | .RS 4 | |
384 | Shows the current neighbour table in kernel. | |
385 | .RE | |
386 | .PP | |
387 | ip link set x up | |
388 | .RS 4 | |
389 | Bring up interface x. | |
390 | .RE | |
391 | .PP | |
392 | ip link set x down | |
0db70c59 AA |
393 | .RS 4 |
394 | Bring down interface x. | |
395 | .RE | |
396 | .PP | |
397 | ip route | |
398 | .RS 4 | |
399 | Show table routes. | |
400 | .RE | |
401 | ||
985794ad | 402 | .SH HISTORY |
985794ad SH |
403 | .B ip |
404 | was 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 | 427 | Report any bugs to the Network Developers mailing list |
2a9721f1 SH |
428 | .B <netdev@vger.kernel.org> |
429 | where the development and maintenance is primarily done. | |
430 | You do not have to be subscribed to the list to send a message there. | |
985794ad SH |
431 | |
432 | .SH AUTHOR | |
2a9721f1 | 433 | Original Manpage by Michail Litvak <mci@owl.openwall.com> |