1IP-ADDRESS(8)                        Linux                       IP-ADDRESS(8)
2
3
4

NAME

6       ip-address - protocol address management
7

SYNOPSIS

9       ip [ OPTIONS ] address  { COMMAND | help }
10
11
12       ip address { add | change | replace } IFADDR dev IFNAME [ LIFETIME ] [
13               CONFFLAG-LIST ]
14
15       ip address del IFADDR dev IFNAME [ mngtmpaddr ]
16
17       ip address { save | flush } [ dev IFNAME ] [ scope SCOPE-ID ] [ metric
18               METRIC ] [ to PREFIX ] [ FLAG-LIST ] [ label PATTERN ] [ up ]
19
20       ip address [ show [ dev IFNAME ] [ scope SCOPE-ID ] [ to PREFIX ] [
21               FLAG-LIST ] [ label PATTERN ] [ master DEVICE ] [ type TYPE ] [
22               vrf NAME ] [ up ] [ nomaster ] ]
23
24       ip address { showdump | restore }
25
26       IFADDR := PREFIX | ADDR peer PREFIX [ broadcast ADDR ] [ anycast ADDR ]
27               [ label LABEL ] [ scope SCOPE-ID ]
28
29       SCOPE-ID := [ host | link | global | NUMBER ]
30
31       FLAG-LIST := [ FLAG-LIST ] FLAG
32
33       FLAG := [ [-]permanent | [-]dynamic | [-]secondary | [-]primary |
34               [-]tentative | [-]deprecated | [-]dadfailed | [-]temporary |
35               CONFFLAG-LIST ]
36
37       CONFFLAG-LIST := [ CONFFLAG-LIST ] CONFFLAG
38
39       CONFFLAG := [ home | mngtmpaddr | nodad | optimistic | noprefixroute |
40               autojoin ]
41
42       LIFETIME := [ valid_lft LFT ] [ preferred_lft LFT ]
43
44       LFT := [ forever | SECONDS ]
45
46       TYPE := [ bridge | bridge_slave | bond | bond_slave | can | dummy | hsr
47               | ifb | ipoib | macvlan | macvtap | vcan | veth | vlan | vxlan
48               | ip6tnl | ipip | sit | gre | gretap | erspan | ip6gre |
49               ip6gretap | ip6erspan | vti | vrf | nlmon | ipvlan | lowpan |
50               geneve | macsec ]
51
52

DESCRIPTION

54       The address is a protocol (IPv4 or IPv6) address attached to a network
55       device. Each device must have at least one address to use the corre‐
56       sponding protocol. It is possible to have several different addresses
57       attached to one device. These addresses are not discriminated, so that
58       the term alias is not quite appropriate for them and we do not use it
59       in this document.
60
61       The ip address command displays addresses and their properties, adds
62       new addresses and deletes old ones.
63
64
65   ip address add - add new protocol address.
66       dev IFNAME
67              the name of the device to add the address to.
68
69
70       local ADDRESS (default)
71              the address of the interface. The format of the address depends
72              on the protocol. It is a dotted quad for IP and a sequence of
73              hexadecimal halfwords separated by colons for IPv6. The ADDRESS
74              may be followed by a slash and a decimal number which encodes
75              the network prefix length.
76
77
78       peer ADDRESS
79              the address of the remote endpoint for pointopoint interfaces.
80              Again, the ADDRESS may be followed by a slash and a decimal num‐
81              ber, encoding the network prefix length. If a peer address is
82              specified, the local address cannot have a prefix length. The
83              network prefix is associated with the peer rather than with the
84              local address.
85
86
87       broadcast ADDRESS
88              the broadcast address on the interface.
89
90              It is possible to use the special symbols '+' and '-' instead of
91              the broadcast address. In this case, the broadcast address is
92              derived by setting/resetting the host bits of the interface pre‐
93              fix.
94
95
96       label LABEL
97              Each address may be tagged with a label string.  The maximum al‐
98              lowed total length of label is 15 characters.
99
100
101       scope SCOPE_VALUE
102              the scope of the area where this address is valid.  The avail‐
103              able scopes are listed in file /etc/iproute2/rt_scopes.  Prede‐
104              fined scope values are:
105
106                      global - the address is globally valid.
107
108                      site - (IPv6 only, deprecated) the address is site lo‐
109                      cal, i.e. it is valid inside this site.
110
111                      link - the address is link local, i.e. it is valid only
112                      on this device.
113
114                      host - the address is valid only inside this host.
115
116
117       metric NUMBER
118              priority of prefix route associated with address.
119
120
121       valid_lft LFT
122              the valid lifetime of this address; see section 5.5.4 of RFC
123              4862. When it expires, the address is removed by the kernel.
124              Defaults to forever.
125
126
127       preferred_lft LFT
128              the preferred lifetime of this address; see section 5.5.4 of RFC
129              4862. When it expires, the address is no longer used for new
130              outgoing connections. Defaults to forever.
131
132
133       home   (IPv6 only) designates this address the "home address" as de‐
134              fined in RFC 6275.
135
136
137       mngtmpaddr
138              (IPv6 only) make the kernel manage temporary addresses created
139              from this one as template on behalf of Privacy Extensions
140              (RFC3041). For this to become active, the use_tempaddr sysctl
141              setting has to be set to a value greater than zero.  The given
142              address needs to have a prefix length of 64. This flag allows to
143              use privacy extensions in a manually configured network, just
144              like if stateless auto-configuration was active.
145
146
147       nodad  (IPv6 only) do not perform Duplicate Address Detection (RFC
148              4862) when adding this address.
149
150
151       optimistic
152              (IPv6 only) When performing Duplicate Address Detection, use the
153              RFC 4429 optimistic variant.
154
155
156       noprefixroute
157              Do not automatically create a route for the network prefix of
158              the added address, and don't search for one to delete when re‐
159              moving the address. Changing an address to add this flag will
160              remove the automatically added prefix route, changing it to re‐
161              move this flag will create the prefix route automatically.
162
163
164       autojoin
165              Joining multicast groups on Ethernet level via ip maddr command
166              does not work if connected to an Ethernet switch that does IGMP
167              snooping since the switch would not replicate multicast packets
168              on ports that did not have IGMP reports for the multicast ad‐
169              dresses.
170
171              Linux VXLAN interfaces created via ip link add vxlan have the
172              group option that enables them to do the required join.
173
174              Using the autojoin flag when adding a multicast address enables
175              similar functionality for Openvswitch VXLAN interfaces as well
176              as other tunneling mechanisms that need to receive multicast
177              traffic.
178
179
180   ip address delete - delete protocol address
181       Arguments: coincide with the arguments of ip addr add.  The device name
182       is a required argument. The rest are optional.  If no arguments are
183       given, the first address is deleted.
184
185
186   ip address show - look at protocol addresses
187       dev IFNAME (default)
188              name of device.
189
190
191       scope SCOPE_VAL
192              only list addresses with this scope.
193
194
195       to PREFIX
196              only list addresses matching this prefix.
197
198
199       label PATTERN
200              only list addresses with labels matching the PATTERN.  PATTERN
201              is a usual shell style pattern.
202
203
204       master DEVICE
205              only list interfaces enslaved to this master device.
206
207
208       vrf NAME
209              only list interfaces enslaved to this vrf.
210
211
212       type TYPE
213              only list interfaces of the given type.
214
215              Note that the type name is not checked against the list of sup‐
216              ported types - instead it is sent as-is to the kernel. Later it
217              is used to filter the returned interface list by comparing it
218              with the relevant attribute in case the kernel didn't filter al‐
219              ready. Therefore any string is accepted, but may lead to empty
220              output.
221
222
223       up     only list running interfaces.
224
225
226       nomaster
227              only list interfaces with no master.
228
229
230       dynamic and permanent
231              (IPv6 only) only list addresses installed due to stateless ad‐
232              dress configuration or only list permanent (not dynamic) ad‐
233              dresses. These two flags are inverses of each other, so -dynamic
234              is equal to permanent and -permanent is equal to dynamic.
235
236
237       tentative
238              (IPv6 only) only list addresses which have not yet passed dupli‐
239              cate address detection.
240
241
242       -tentative
243              (IPv6 only) only list addresses which are not in the process of
244              duplicate address detection currently.
245
246
247       deprecated
248              (IPv6 only) only list deprecated addresses.
249
250
251       -deprecated
252              (IPv6 only) only list addresses not being deprecated.
253
254
255       dadfailed
256              (IPv6 only) only list addresses which have failed duplicate ad‐
257              dress detection.
258
259
260       -dadfailed
261              (IPv6 only) only list addresses which have not failed duplicate
262              address detection.
263
264
265       temporary or secondary
266              List temporary IPv6 or secondary IPv4 addresses only. The Linux
267              kernel shares a single bit for those, so they are actually
268              aliases for each other although the meaning differs depending on
269              address family.
270
271
272       -temporary or -secondary
273              These flags are aliases for primary.
274
275
276       primary
277              List only primary addresses, in IPv6 exclude temporary ones.
278              This flag is the inverse of temporary and secondary.
279
280
281       -primary
282              This is an alias for temporary or secondary.
283
284
285   ip address flush - flush protocol addresses
286       This command flushes the protocol addresses selected by some criteria.
287
288
289       This command has the same arguments as show except that type and master
290       selectors are not supported.  Another difference is that it does not
291       run when no arguments are given.
292
293
294       Warning: This command and other flush commands are unforgiving. They
295       will cruelly purge all the addresses.
296
297
298       With the -statistics option, the command becomes verbose. It prints out
299       the number of deleted addresses and the number of rounds made to flush
300       the address list.  If this option is given twice, ip address flush also
301       dumps all the deleted addresses in the format described in the previous
302       subsection.
303
304

EXAMPLES

306       ip address show
307           Shows IPv4 and IPv6 addresses assigned to all network interfaces.
308           The 'show' subcommand can be omitted.
309
310       ip address show up
311           Same as above except that only addresses assigned to active network
312           interfaces are shown.
313
314       ip address show dev eth0
315           Shows IPv4 and IPv6 addresses assigned to network interface eth0.
316
317       ip address add 2001:0db8:85a3::0370:7334/64 dev eth1
318           Adds an IPv6 address to network interface eth1.
319
320       ip address delete 2001:0db8:85a3::0370:7334/64 dev eth1
321           Delete the IPv6 address added above.
322
323       ip address flush dev eth4 scope global
324           Removes all global IPv4 and IPv6 addresses from device eth4. With‐
325           out 'scope global' it would remove all addresses including IPv6
326           link-local ones.
327
328

SEE ALSO

330       ip(8)
331
332

AUTHOR

334       Original Manpage by Michail Litvak <mci@owl.openwall.com>
335
336
337
338iproute2                          20 Dec 2011                    IP-ADDRESS(8)
Impressum