]> git.proxmox.com Git - mirror_iproute2.git/blob - man/man8/ip-address.8.in
ip {link,address}: add 'macsec' item to TYPE list
[mirror_iproute2.git] / man / man8 / ip-address.8.in
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 del"
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 to
31 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
32 .B label
33 .IR PATTERN " ] [ " up " ]"
34
35 .ti -8
36 .BR "ip address" " [ " show " [ " dev
37 .IR IFNAME " ] [ "
38 .B scope
39 .IR SCOPE-ID " ] [ "
40 .B to
41 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
42 .B label
43 .IR PATTERN " ] [ "
44 .B master
45 .IR DEVICE " ] [ "
46 .B type
47 .IR TYPE " ] [ "
48 .B vrf
49 .IR NAME " ] [ "
50 .BR up " ] ]"
51
52 .ti -8
53 .BR "ip address" " { " showdump " | " restore " }"
54
55 .ti -8
56 .IR IFADDR " := " PREFIX " | " ADDR
57 .B peer
58 .IR PREFIX " [ "
59 .B broadcast
60 .IR ADDR " ] [ "
61 .B anycast
62 .IR ADDR " ] [ "
63 .B label
64 .IR LABEL " ] [ "
65 .B scope
66 .IR SCOPE-ID " ]"
67
68 .ti -8
69 .IR SCOPE-ID " := "
70 .RB "[ " host " | " link " | " global " | "
71 .IR NUMBER " ]"
72
73 .ti -8
74 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
75
76 .ti -8
77 .IR FLAG " := "
78 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " |"
79 .RB [ - ] tentative " | [" - ] deprecated " | [" - ] dadfailed " |"
80 .BR temporary " |"
81 .IR CONFFLAG-LIST " ]"
82
83 .ti -8
84 .IR CONFFLAG-LIST " := [ " CONFFLAG-LIST " ] " CONFFLAG
85
86 .ti -8
87 .IR CONFFLAG " := "
88 .RB "[ " home " | " mngtmpaddr " | " nodad " | " noprefixroute " | " autojoin " ]"
89
90 .ti -8
91 .IR LIFETIME " := [ "
92 .BI valid_lft " LFT"
93 .RB "] [ " preferred_lft
94 .IR LFT " ]"
95
96 .ti -8
97 .IR LFT " := [ "
98 .BR forever " |"
99 .IR SECONDS " ]"
100
101 .ti -8
102 .IR TYPE " := [ "
103 .BR bridge " | "
104 .BR bridge_slave " |"
105 .BR bond " | "
106 .BR bond_slave " |"
107 .BR can " | "
108 .BR dummy " | "
109 .BR hsr " | "
110 .BR ifb " | "
111 .BR ipoib " |"
112 .BR macvlan " | "
113 .BR macvtap " | "
114 .BR vcan " | "
115 .BR veth " | "
116 .BR vlan " | "
117 .BR vxlan " |"
118 .BR ip6tnl " |"
119 .BR ipip " |"
120 .BR sit " |"
121 .BR gre " |"
122 .BR gretap " |"
123 .BR ip6gre " |"
124 .BR ip6gretap " |"
125 .BR vti " |"
126 .BR vrf " |"
127 .BR nlmon " |"
128 .BR ipvlan " |"
129 .BR lowpan " |"
130 .BR geneve " |"
131 .BR macsec " ]"
132
133 .SH "DESCRIPTION"
134 The
135 .B address
136 is a protocol (IPv4 or IPv6) address attached
137 to a network device. Each device must have at least one address
138 to use the corresponding protocol. It is possible to have several
139 different addresses attached to one device. These addresses are not
140 discriminated, so that the term
141 .B alias
142 is not quite appropriate for them and we do not use it in this document.
143 .sp
144 The
145 .B ip address
146 command displays addresses and their properties, adds new addresses
147 and deletes old ones.
148
149 .SS ip address add - add new protocol address.
150
151 .TP
152 .BI dev " IFNAME "
153 the name of the device to add the address to.
154
155 .TP
156 .BI local " ADDRESS " (default)
157 the address of the interface. The format of the address depends
158 on the protocol. It is a dotted quad for IP and a sequence of
159 hexadecimal halfwords separated by colons for IPv6. The
160 .I ADDRESS
161 may be followed by a slash and a decimal number which encodes
162 the network prefix length.
163
164 .TP
165 .BI peer " ADDRESS"
166 the address of the remote endpoint for pointopoint interfaces.
167 Again, the
168 .I ADDRESS
169 may be followed by a slash and a decimal number, encoding the network
170 prefix length. If a peer address is specified, the local address
171 cannot have a prefix length. The network prefix is associated
172 with the peer rather than with the local address.
173
174 .TP
175 .BI broadcast " ADDRESS"
176 the broadcast address on the interface.
177 .sp
178 It is possible to use the special symbols
179 .B '+'
180 and
181 .B '-'
182 instead of the broadcast address. In this case, the broadcast address
183 is derived by setting/resetting the host bits of the interface prefix.
184
185 .TP
186 .BI label " LABEL"
187 Each address may be tagged with a label string.
188 In order to preserve compatibility with Linux-2.0 net aliases,
189 this string must coincide with the name of the device or must be prefixed
190 with the device name followed by colon.
191
192 .TP
193 .BI scope " SCOPE_VALUE"
194 the scope of the area where this address is valid.
195 The available scopes are listed in file
196 .BR "@SYSCONFDIR@/rt_scopes" .
197 Predefined scope values are:
198
199 .in +8
200 .B global
201 - the address is globally valid.
202 .sp
203 .B site
204 - (IPv6 only, deprecated) the address is site local, i.e. it is
205 valid inside this site.
206 .sp
207 .B link
208 - the address is link local, i.e. it is valid only on this device.
209 .sp
210 .B host
211 - the address is valid only inside this host.
212 .in -8
213
214 .TP
215 .BI valid_lft " LFT"
216 the valid lifetime of this address; see section 5.5.4 of
217 RFC 4862. When it expires, the address is removed by the kernel.
218 Defaults to
219 .BR "forever" .
220
221 .TP
222 .BI preferred_lft " LFT"
223 the preferred lifetime of this address; see section 5.5.4
224 of RFC 4862. When it expires, the address is no longer used for new
225 outgoing connections. Defaults to
226 .BR "forever" .
227
228 .TP
229 .B home
230 (IPv6 only) designates this address the "home address" as defined in
231 RFC 6275.
232
233 .TP
234 .B mngtmpaddr
235 (IPv6 only) make the kernel manage temporary addresses created from this one as
236 template on behalf of Privacy Extensions (RFC3041). For this to become active,
237 the \fBuse_tempaddr\fP sysctl setting has to be set to a value greater than
238 zero. The given address needs to have a prefix length of 64. This flag allows
239 to use privacy extensions in a manually configured network, just like if
240 stateless auto-configuration was active.
241
242 .TP
243 .B nodad
244 (IPv6 only) do not perform Duplicate Address Detection (RFC 4862) when
245 adding this address.
246
247 .TP
248 .B noprefixroute
249 Do not automatically create a route for the network prefix of the added
250 address, and don't search for one to delete when removing the address. Changing
251 an address to add this flag will remove the automatically added prefix route,
252 changing it to remove this flag will create the prefix route automatically.
253
254 .TP
255 .B autojoin
256 Joining multicast groups on Ethernet level via
257 .B "ip maddr"
258 command does not work if connected to an Ethernet switch that does IGMP
259 snooping since the switch would not replicate multicast packets on ports that
260 did not have IGMP reports for the multicast addresses.
261
262 Linux VXLAN interfaces created via
263 .B "ip link add vxlan"
264 have the
265 .B group
266 option that enables them to do the required join.
267
268 Using the
269 .B autojoin
270 flag when adding a multicast address enables similar functionality for
271 Openvswitch VXLAN interfaces as well as other tunneling mechanisms that need to
272 receive multicast traffic.
273
274 .SS ip address delete - delete protocol address
275 .B Arguments:
276 coincide with the arguments of
277 .B ip addr add.
278 The device name is a required argument. The rest are optional.
279 If no arguments are given, the first address is deleted.
280
281 .SS ip address show - look at protocol addresses
282
283 .TP
284 .BI dev " IFNAME " (default)
285 name of device.
286
287 .TP
288 .BI scope " SCOPE_VAL"
289 only list addresses with this scope.
290
291 .TP
292 .BI to " PREFIX"
293 only list addresses matching this prefix.
294
295 .TP
296 .BI label " PATTERN"
297 only list addresses with labels matching the
298 .IR "PATTERN" .
299 .I PATTERN
300 is a usual shell style pattern.
301
302 .TP
303 .BI master " DEVICE"
304 only list interfaces enslaved to this master device.
305
306 .TP
307 .BI vrf " NAME "
308 only list interfaces enslaved to this vrf.
309
310 .TP
311 .BI type " TYPE"
312 only list interfaces of the given type.
313
314 Note that the type name is not checked against the list of supported types -
315 instead it is sent as-is to the kernel. Later it is used to filter the returned
316 interface list by comparing it with the relevant attribute in case the kernel
317 didn't filter already. Therefore any string is accepted, but may lead to empty
318 output.
319
320 .TP
321 .B up
322 only list running interfaces.
323
324 .TP
325 .BR dynamic " and " permanent
326 (IPv6 only) only list addresses installed due to stateless
327 address configuration or only list permanent (not dynamic)
328 addresses.
329
330 .TP
331 .B tentative
332 (IPv6 only) only list addresses which have not yet passed duplicate
333 address detection.
334
335 .TP
336 .B -tentative
337 (IPv6 only) only list addresses which are not in the process of
338 duplicate address detection currently.
339
340 .TP
341 .B deprecated
342 (IPv6 only) only list deprecated addresses.
343
344 .TP
345 .B -deprecated
346 (IPv6 only) only list addresses not being deprecated.
347
348 .TP
349 .B dadfailed
350 (IPv6 only) only list addresses which have failed duplicate
351 address detection.
352
353 .TP
354 .B -dadfailed
355 (IPv6 only) only list addresses which have not failed duplicate
356 address detection.
357
358 .TP
359 .B temporary
360 (IPv6 only) only list temporary addresses.
361
362 .TP
363 .BR primary " and " secondary
364 only list primary (or secondary) addresses.
365
366 .SS ip address flush - flush protocol addresses
367 This command flushes the protocol addresses selected by some criteria.
368
369 .PP
370 This command has the same arguments as
371 .BR show " except that " type " and " master " selectors are not supported."
372 Another difference is that it does not run when no arguments are given.
373
374 .PP
375 .B Warning:
376 This command and other
377 .B flush
378 commands are unforgiving. They will cruelly purge all the addresses.
379
380 .PP
381 With the
382 .B -statistics
383 option, the command becomes verbose. It prints out the number of deleted
384 addresses and the number of rounds made to flush the address list.
385 If this option is given twice,
386 .B ip address flush
387 also dumps all the deleted addresses in the format described in the
388 previous subsection.
389
390 .SH "EXAMPLES"
391 .PP
392 ip address show
393 .RS 4
394 Shows IPv4 and IPv6 addresses assigned to all network interfaces. The 'show'
395 subcommand can be omitted.
396 .RE
397 .PP
398 ip address show up
399 .RS 4
400 Same as above except that only addresses assigned to active network interfaces
401 are shown.
402 .RE
403 .PP
404 ip address show dev eth0
405 .RS 4
406 Shows IPv4 and IPv6 addresses assigned to network interface eth0.
407 .RE
408 .PP
409 ip address add 2001:0db8:85a3::0370:7334/64 dev eth1
410 .RS 4
411 Adds an IPv6 address to network interface eth1.
412 .RE
413 .PP
414 ip address delete 2001:0db8:85a3::0370:7334/64 dev eth1
415 .RS 4
416 Delete the IPv6 address added above.
417 .RE
418 .PP
419 ip address flush dev eth4 scope global
420 .RS 4
421 Removes all global IPv4 and IPv6 addresses from device eth4. Without 'scope
422 global' it would remove all addresses including IPv6 link-local ones.
423 .RE
424
425 .SH SEE ALSO
426 .br
427 .BR ip (8)
428
429 .SH AUTHOR
430 Original Manpage by Michail Litvak <mci@owl.openwall.com>