Debian Codegraph @

upstream/opensuse-leap-16-1/man8/ip-address.8

raw
1 .TH "IP\-ADDRESS" 8 "20 Dec 2011" "iproute2" "Linux"
2 .SH "NAME"
3 ip-address \- protocol address management
4 .SH "SYNOPSIS"
5 .sp
6 .ad l
7 .in +8
8 .ti -8
9 .B ip
10 .RI "[ " OPTIONS " ]"
11 .B address
12 .RI " { " COMMAND " | "
13 .BR help " }"
14 .sp
15
16 .ti -8
17 .BR "ip address" " { " add " | " change " | " replace " } "
18 .IB IFADDR " dev " IFNAME
19 .RI "[ " LIFETIME " ] [ " CONFFLAG-LIST " ]"
20
21 .ti -8
22 .BR "ip address delete"
23 .IB IFADDR " dev " IFNAME " [ " mngtmpaddr " ]"
24
25 .ti -8
26 .BR "ip address" " { " save " | " flush " } [ " dev
27 .IR IFNAME " ] [ "
28 .B scope
29 .IR SCOPE-ID " ] [ "
30 .B metric
31 .IR METRIC " ] [ "
32 .B to
33 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
34 .B label
35 .IR PATTERN " ] [ " up " ]"
36
37 .ti -8
38 .BR "ip address" " [ " show " [ " dev
39 .IR IFNAME " ] [ "
40 .B scope
41 .IR SCOPE-ID " ] [ "
42 .B to
43 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
44 .B label
45 .IR PATTERN " ] [ "
46 .B master
47 .IR DEVICE " ] [ "
48 .B type
49 .IR TYPE " ] [ "
50 .B vrf
51 .IR NAME " ] [ "
52 .BR up " ] ["
53 .BR nomaster " ]"
54 .B proto
55 .IR ADDRPROTO " ] ]"
56
57 .ti -8
58 .BR "ip address" " { " showdump " | " restore " }"
59
60 .ti -8
61 .IR IFADDR " := " PREFIX " | " ADDR
62 .B peer
63 .IR PREFIX " [ "
64 .B broadcast
65 .IR ADDR " ] [ "
66 .B anycast
67 .IR ADDR " ] [ "
68 .B label
69 .IR LABEL " ] [ "
70 .B scope
71 .IR SCOPE-ID " ] [ "
72 .B proto
73 .IR ADDRPROTO " ]"
74
75 .ti -8
76 .IR SCOPE-ID " := "
77 .RB "[ " host " | " link " | " global " | "
78 .IR NUMBER " ]"
79
80 .ti -8
81 .IR ADDRPROTO " := [ "
82 .IR NAME " | " NUMBER " ]"
83
84 .ti -8
85 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
86
87 .ti -8
88 .IR FLAG " := ["
89 .RB [ - ] permanent " |"
90 .RB [ - ] dynamic " |"
91 .RB [ - ] secondary " |"
92 .RB [ - ] primary " |"
93 .RB [ - ] tentative " |"
94 .RB [ - ] deprecated " |"
95 .RB [ - ] dadfailed " |"
96 .RB [ - ] temporary " |"
97 .IR CONFFLAG-LIST " ]"
98
99 .ti -8
100 .IR CONFFLAG-LIST " := [ " CONFFLAG-LIST " ] " CONFFLAG
101
102 .ti -8
103 .IR CONFFLAG " := "
104 .RB "[ " home " | " mngtmpaddr " | " nodad " | " optimistic " | " noprefixroute " | " autojoin " ]"
105
106 .ti -8
107 .IR LIFETIME " := [ "
108 .BI valid_lft " LFT"
109 .RB "] [ " preferred_lft
110 .IR LFT " ]"
111
112 .ti -8
113 .IR LFT " := [ "
114 .BR forever " |"
115 .IR SECONDS " ]"
116
117 .ti -8
118 .IR TYPE " := [ "
119 .BR bridge " | "
120 .BR bridge_slave " |"
121 .BR bond " | "
122 .BR bond_slave " |"
123 .BR can " | "
124 .BR dummy " | "
125 .BR hsr " | "
126 .BR ifb " | "
127 .BR ipoib " |"
128 .BR macvlan " | "
129 .BR macvtap " | "
130 .BR vcan " | "
131 .BR veth " | "
132 .BR vlan " | "
133 .BR vxlan " |"
134 .BR ip6tnl " |"
135 .BR ipip " |"
136 .BR sit " |"
137 .BR gre " |"
138 .BR gretap " |"
139 .BR erspan " |"
140 .BR ip6gre " |"
141 .BR ip6gretap " |"
142 .BR ip6erspan " |"
143 .BR vti " |"
144 .BR vrf " |"
145 .BR nlmon " |"
146 .BR ipvlan " |"
147 .BR lowpan " |"
148 .BR geneve " |"
149 .BR macsec " |"
150 .BR netkit " ]"
151
152 .SH "DESCRIPTION"
153 The
154 .B address
155 is a protocol (IPv4 or IPv6) address attached
156 to a network device. Each device must have at least one address
157 to use the corresponding protocol. It is possible to have several
158 different addresses attached to one device. These addresses are not
159 discriminated, so that the term
160 .B alias
161 is not quite appropriate for them and we do not use it in this document.
162 .sp
163 The
164 .B ip address
165 command displays addresses and their properties, adds new addresses
166 and deletes old ones.
167
168 .SS ip address add - add new protocol address.
169
170 .TP
171 .BI dev " IFNAME "
172 the name of the device to add the address to.
173
174 .TP
175 .BI local " ADDRESS " (default)
176 the address of the interface. The format of the address depends
177 on the protocol. It is a dotted quad for IP and a sequence of
178 hexadecimal halfwords separated by colons for IPv6. The
179 .I ADDRESS
180 may be followed by a slash and a decimal number which encodes
181 the network prefix length.
182
183 .TP
184 .BI peer " ADDRESS"
185 the address of the remote endpoint for pointopoint interfaces.
186 Again, the
187 .I ADDRESS
188 may be followed by a slash and a decimal number, encoding the network
189 prefix length. If a peer address is specified, the local address
190 cannot have a prefix length. The network prefix is associated
191 with the peer rather than with the local address.
192
193 .TP
194 .BI broadcast " ADDRESS"
195 the broadcast address on the interface.
196 .sp
197 It is possible to use the special symbols
198 .B '+'
199 and
200 .B '-'
201 instead of the broadcast address. In this case, the broadcast address
202 is derived by setting/resetting the host bits of the interface prefix.
203
204 .TP
205 .BI label " LABEL"
206 Each address may be tagged with a label string.
207 The maximum allowed total length of label is 15 characters.
208
209 .TP
210 .BI scope " SCOPE_VALUE"
211 the scope of the area where this address is valid.
212 The available scopes are listed in
213 .BR /usr/share/iproute2/rt_scopes " or " /etc/iproute2/rt_scopes
214 (has precedence if exists).
215 Predefined scope values are:
216
217 .in +8
218 .B global
219 - the address is globally valid.
220 .sp
221 .B site
222 - (IPv6 only, deprecated) the address is site local, i.e. it is
223 valid inside this site.
224 .sp
225 .B link
226 - the address is link local, i.e. it is valid only on this device.
227 .sp
228 .B host
229 - the address is valid only inside this host.
230 .in -8
231
232 .TP
233 .BI metric " NUMBER"
234 priority of prefix route associated with address.
235
236 .TP
237 .BI valid_lft " LFT"
238 the valid lifetime of this address; see section 5.5.4 of
239 RFC 4862. When it expires, the address is removed by the kernel.
240 Defaults to
241 .BR "forever" .
242
243 .TP
244 .BI preferred_lft " LFT"
245 the preferred lifetime of this address; see section 5.5.4
246 of RFC 4862. When it expires, the address is no longer used for new
247 outgoing connections. Defaults to
248 .BR "forever" .
249
250 .TP
251 .B home
252 (IPv6 only) designates this address the "home address" as defined in
253 RFC 6275.
254
255 .TP
256 .B mngtmpaddr
257 (IPv6 only) make the kernel manage temporary addresses created from this one as
258 template on behalf of Privacy Extensions (RFC3041). For this to become active,
259 the \fBuse_tempaddr\fP sysctl setting has to be set to a value greater than
260 zero. The given address needs to have a prefix length of 64. This flag allows
261 to use privacy extensions in a manually configured network, just like if
262 stateless auto-configuration was active.
263
264 .TP
265 .B nodad
266 (IPv6 only) do not perform Duplicate Address Detection (RFC 4862) when
267 adding this address.
268
269 .TP
270 .B optimistic
271 (IPv6 only) When performing Duplicate Address Detection, use the RFC 4429
272 optimistic variant.
273
274 .TP
275 .B noprefixroute
276 Do not automatically create a route for the network prefix of the added
277 address, and don't search for one to delete when removing the address. Changing
278 an address to add this flag will remove the automatically added prefix route,
279 changing it to remove this flag will create the prefix route automatically.
280
281 .TP
282 .B autojoin
283 Joining multicast groups on Ethernet level via
284 .B "ip maddr"
285 command does not work if connected to an Ethernet switch that does IGMP
286 snooping since the switch would not replicate multicast packets on ports that
287 did not have IGMP reports for the multicast addresses.
288
289 Linux VXLAN interfaces created via
290 .B "ip link add vxlan"
291 have the
292 .B group
293 option that enables them to do the required join.
294
295 Using the
296 .B autojoin
297 flag when adding a multicast address enables similar functionality for
298 Openvswitch VXLAN interfaces as well as other tunneling mechanisms that need to
299 receive multicast traffic.
300
301 .TP
302 .BI proto " ADDRPROTO"
303 the protocol identifier of this route.
304 .I ADDRPROTO
305 may be a number or a string from the file
306 .BR "/etc/iproute2/rt_addrprotos" .
307 If the protocol ID is not given,
308
309 .B ip assumes protocol 0. Several protocol
310 values have a fixed interpretation. Namely:
311
312 .in +8
313 .B kernel_lo
314 - The ::1 address that kernel installs on a loopback netdevice has this
315 protocol value
316 .sp
317
318 .B kernel_ra
319 - IPv6 addresses installed in response to router advertisement messages
320 .sp
321
322 .B kernel_ll
323 - Link-local addresses have this protocol value
324 .sp
325 .in -8
326
327 .sp
328 The rest of the values are not reserved and the administrator is free
329 to assign (or not to assign) protocol tags.
330
331 .SS ip address delete - delete protocol address
332 .B Arguments:
333 coincide with the arguments of
334 .B ip address add.
335 .sp
336 The device name is a required argument.
337
338 .SS ip address show - look at protocol addresses
339
340 .TP
341 .BI dev " IFNAME " (default)
342 name of device.
343
344 .TP
345 .BI scope " SCOPE_VAL"
346 only list addresses with this scope.
347
348 .TP
349 .BI to " PREFIX"
350 only list addresses matching this prefix.
351
352 .TP
353 .BI label " PATTERN"
354 only list addresses with labels matching the
355 .IR "PATTERN" .
356 .I PATTERN
357 is a usual shell style pattern.
358
359 .TP
360 .BI master " DEVICE"
361 only list interfaces enslaved to this master device.
362
363 .TP
364 .BI vrf " NAME "
365 only list interfaces enslaved to this vrf.
366
367 .TP
368 .BI type " TYPE"
369 only list interfaces of the given type.
370
371 Note that the type name is not checked against the list of supported types -
372 instead it is sent as-is to the kernel. Later it is used to filter the returned
373 interface list by comparing it with the relevant attribute in case the kernel
374 didn't filter already. Therefore any string is accepted, but may lead to empty
375 output.
376
377 .TP
378 .B up
379 only list running interfaces.
380
381 .TP
382 .B nomaster
383 only list interfaces with no master.
384
385 .TP
386 .BR dynamic " and " permanent
387 (IPv6 only) only list addresses installed due to stateless
388 address configuration or only list permanent (not dynamic)
389 addresses. These two flags are inverses of each other, so
390 .BR -dynamic " is equal to " permanent " and "
391 .BR -permanent " is equal to " dynamic .
392
393 .TP
394 .B tentative
395 (IPv6 only) only list addresses which have not yet passed duplicate
396 address detection.
397
398 .TP
399 .B -tentative
400 (IPv6 only) only list addresses which are not in the process of
401 duplicate address detection currently.
402
403 .TP
404 .B deprecated
405 (IPv6 only) only list deprecated addresses.
406
407 .TP
408 .B -deprecated
409 (IPv6 only) only list addresses not being deprecated.
410
411 .TP
412 .B dadfailed
413 (IPv6 only) only list addresses which have failed duplicate
414 address detection.
415
416 .TP
417 .B -dadfailed
418 (IPv6 only) only list addresses which have not failed duplicate
419 address detection.
420
421 .TP
422 .BR temporary " or " secondary
423 List temporary IPv6 or secondary IPv4 addresses only. The Linux kernel shares a
424 single bit for those, so they are actually aliases for each other although the
425 meaning differs depending on address family.
426
427 .TP
428 .BR -temporary " or " -secondary
429 These flags are aliases for
430 .BR primary .
431
432 .TP
433 .B primary
434 List only primary addresses, in IPv6 exclude temporary ones. This flag is the
435 inverse of
436 .BR temporary " and " secondary .
437
438 .TP
439 .B -primary
440 This is an alias for
441 .BR temporary " or " secondary .
442
443 .TP
444 .BI proto " ADDRPROTO"
445 Only show addresses with a given protocol, or those for which the kernel
446 response did not include protocol. See the corresponding argument to
447 .B ip address add
448 for details about address protocols.
449
450 .SS ip address flush - flush protocol addresses
451 This command flushes the protocol addresses selected by some criteria.
452
453 .PP
454 This command has the same arguments as
455 .BR show " except that " type " and " master " selectors are not supported."
456 Another difference is that it does not run when no arguments are given.
457
458 .PP
459 .B Warning:
460 This command and other
461 .B flush
462 commands are unforgiving. They will cruelly purge all the addresses.
463
464 .PP
465 With the
466 .B -statistics
467 option, the command becomes verbose. It prints out the number of deleted
468 addresses and the number of rounds made to flush the address list.
469 If this option is given twice,
470 .B ip address flush
471 also dumps all the deleted addresses in the format described in the
472 previous subsection.
473
474 .SH "EXAMPLES"
475 .PP
476 ip address show
477 .RS 4
478 Shows IPv4 and IPv6 addresses assigned to all network interfaces. The 'show'
479 subcommand can be omitted.
480 .RE
481 .PP
482 ip address show up
483 .RS 4
484 Same as above except that only addresses assigned to active network interfaces
485 are shown.
486 .RE
487 .PP
488 ip address show dev eth0
489 .RS 4
490 Shows IPv4 and IPv6 addresses assigned to network interface eth0.
491 .RE
492 .PP
493 ip address add 2001:0db8:85a3::0370:7334/64 dev eth1
494 .RS 4
495 Adds an IPv6 address to network interface eth1.
496 .RE
497 .PP
498 ip address delete 2001:0db8:85a3::0370:7334/64 dev eth1
499 .RS 4
500 Delete the IPv6 address added above.
501 .RE
502 .PP
503 ip address flush dev eth4 scope global
504 .RS 4
505 Removes all global IPv4 and IPv6 addresses from device eth4. Without 'scope
506 global' it would remove all addresses including IPv6 link-local ones.
507 .RE
508
509 .SH SEE ALSO
510 .br
511 .BR ip (8)
512
513 .SH AUTHOR
514 Original Manpage by Michail Litvak <[email protected]>