1 .TH "IP\-ADDRESS" 8 "20 Dec 2011" "iproute2" "Linux"
3 ip-address \- protocol address management
12 .RI " { " COMMAND " | "
17 .BR "ip address" " { " add " | " change " | " replace " } "
18 .IB IFADDR " dev " IFNAME
19 .RI "[ " LIFETIME " ] [ " CONFFLAG-LIST " ]"
23 .IB IFADDR " dev " IFNAME " [ " mngtmpaddr " ]"
26 .BR "ip address" " { " save " | " flush " } [ " dev
31 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
33 .IR PATTERN " ] [ " up " ]"
36 .BR "ip address" " [ " show " [ " dev
41 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
53 .BR "ip address" " { " showdump " | " restore " }"
56 .IR IFADDR " := " PREFIX " | " ADDR
70 .RB "[ " host " | " link " | " global " | "
74 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
78 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " |"
79 .RB [ - ] tentative " | [" - ] deprecated " | [" - ] dadfailed " |"
81 .IR CONFFLAG-LIST " ]"
84 .IR CONFFLAG-LIST " := [ " CONFFLAG-LIST " ] " CONFFLAG
88 .RB "[ " home " | " mngtmpaddr " | " nodad " | " noprefixroute " | " autojoin " ]"
93 .RB "] [ " preferred_lft
104 .BR bridge_slave " |"
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
142 is not quite appropriate for them and we do not use it in this document.
146 command displays addresses and their properties, adds new addresses
147 and deletes old ones.
149 .SS ip address add - add new protocol address.
153 the name of the device to add the address to.
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
161 may be followed by a slash and a decimal number which encodes
162 the network prefix length.
166 the address of the remote endpoint for pointopoint interfaces.
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.
175 .BI broadcast " ADDRESS"
176 the broadcast address on the interface.
178 It is possible to use the special symbols
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.
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.
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:
201 - the address is globally valid.
204 - (IPv6 only, deprecated) the address is site local, i.e. it is
205 valid inside this site.
208 - the address is link local, i.e. it is valid only on this device.
211 - the address is valid only inside this host.
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.
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
230 (IPv6 only) designates this address the "home address" as defined in
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.
244 (IPv6 only) do not perform Duplicate Address Detection (RFC 4862) when
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.
256 Joining multicast groups on Ethernet level via
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.
262 Linux VXLAN interfaces created via
263 .B "ip link add vxlan"
266 option that enables them to do the required join.
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.
274 .SS ip address delete - delete protocol address
276 coincide with the arguments of
278 The device name is a required argument. The rest are optional.
279 If no arguments are given, the first address is deleted.
281 .SS ip address show - look at protocol addresses
284 .BI dev " IFNAME " (default)
288 .BI scope " SCOPE_VAL"
289 only list addresses with this scope.
293 only list addresses matching this prefix.
297 only list addresses with labels matching the
300 is a usual shell style pattern.
304 only list interfaces enslaved to this master device.
308 only list interfaces enslaved to this vrf.
312 only list interfaces of the given type.
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
322 only list running interfaces.
325 .BR dynamic " and " permanent
326 (IPv6 only) only list addresses installed due to stateless
327 address configuration or only list permanent (not dynamic)
332 (IPv6 only) only list addresses which have not yet passed duplicate
337 (IPv6 only) only list addresses which are not in the process of
338 duplicate address detection currently.
342 (IPv6 only) only list deprecated addresses.
346 (IPv6 only) only list addresses not being deprecated.
350 (IPv6 only) only list addresses which have failed duplicate
355 (IPv6 only) only list addresses which have not failed duplicate
360 (IPv6 only) only list temporary addresses.
363 .BR primary " and " secondary
364 only list primary (or secondary) addresses.
366 .SS ip address flush - flush protocol addresses
367 This command flushes the protocol addresses selected by some criteria.
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.
376 This command and other
378 commands are unforgiving. They will cruelly purge all the addresses.
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,
387 also dumps all the deleted addresses in the format described in the
394 Shows IPv4 and IPv6 addresses assigned to all network interfaces. The 'show'
395 subcommand can be omitted.
400 Same as above except that only addresses assigned to active network interfaces
404 ip address show dev eth0
406 Shows IPv4 and IPv6 addresses assigned to network interface eth0.
409 ip address add 2001:0db8:85a3::0370:7334/64 dev eth1
411 Adds an IPv6 address to network interface eth1.
414 ip address delete 2001:0db8:85a3::0370:7334/64 dev eth1
416 Delete the IPv6 address added above.
419 ip address flush dev eth4 scope global
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.
430 Original Manpage by Michail Litvak <mci@owl.openwall.com>