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 ] [ to PRE‐
18               FIX ] [ 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 ] ]
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 | [-]tentative |
34               [-]deprecated | [-]dadfailed | temporary | CONFFLAG-LIST ]
35
36       CONFFLAG-LIST := [ CONFFLAG-LIST ] CONFFLAG
37
38       CONFFLAG := [ home | mngtmpaddr | nodad | noprefixroute | autojoin ]
39
40       LIFETIME := [ valid_lft LFT ] [ preferred_lft LFT ]
41
42       LFT := [ forever | SECONDS ]
43
44       TYPE := [ bridge | bridge_slave | bond | bond_slave | can | dummy | hsr
45               | ifb | ipoib | macvlan | macvtap | vcan | veth | vlan | vxlan
46               | ip6tnl | ipip | sit | gre | gretap | ip6gre | ip6gretap | vti
47               | vrf | nlmon | ipvlan | lowpan | geneve | macsec ]
48
49

DESCRIPTION

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

EXAMPLES

279       ip address show
280           Shows IPv4 and IPv6 addresses assigned to all network interfaces.
281           The 'show' subcommand can be omitted.
282
283       ip address show up
284           Same as above except that only addresses assigned to active network
285           interfaces are shown.
286
287       ip address show dev eth0
288           Shows IPv4 and IPv6 addresses assigned to network interface eth0.
289
290       ip address add 2001:0db8:85a3::0370:7334/64 dev eth1
291           Adds an IPv6 address to network interface eth1.
292
293       ip address delete 2001:0db8:85a3::0370:7334/64 dev eth1
294           Delete the IPv6 address added above.
295
296       ip address flush dev eth4 scope global
297           Removes all global IPv4 and IPv6 addresses from device eth4. With‐
298           out 'scope global' it would remove all addresses including IPv6
299           link-local ones.
300
301

SEE ALSO

303       ip(8)
304
305

AUTHOR

307       Original Manpage by Michail Litvak <mci@owl.openwall.com>
308
309
310
311iproute2                          20 Dec 2011                    IP-ADDRESS(8)
Impressum