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