1 .TH "IP\-ADDRESS" 8 "04 March 2012" "iproute2" "Linux"
3 ip-address \- protocol address management
12 .RI " { " COMMAND " | "
17 .BR "ip address" " { " add " | " change " | " replace " } "
18 .IB IFADDR " dev " STRING
19 .RI "[ " LIFETIME " ] [ " CONFFLAG-LIST " ]"
23 .IB IFADDR " dev " STRING
26 .BR "ip address" " { " show " | " flush " } [ " dev
31 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
36 .IR IFADDR " := " PREFIX " | " ADDR
50 .RB "[ " host " | " link " | " global " | "
54 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
58 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
59 tentative " | " deprecated " | " dadfailed " | " temporary " | " CONFFLAG-LIST " ]"
62 .IR CONFFLAG-LIST " := [ " CONFFLAG-LIST " ] " CONFFLAG
66 .RB "[ " home " | " nodad " ]"
71 .RB "| " preferred_lft
82 is a protocol (IPv4 or IPv6) address attached
83 to a network device. Each device must have at least one address
84 to use the corresponding protocol. It is possible to have several
85 different addresses attached to one device. These addresses are not
86 discriminated, so that the term
88 is not quite appropriate for them and we do not use it in this document.
92 command displays addresses and their properties, adds new addresses
95 .SS ip address add - add new protocol address.
99 the name of the device to add the address to.
102 .BI local " ADDRESS " (default)
103 the address of the interface. The format of the address depends
104 on the protocol. It is a dotted quad for IP and a sequence of
105 hexadecimal halfwords separated by colons for IPv6. The
107 may be followed by a slash and a decimal number which encodes
108 the network prefix length.
112 the address of the remote endpoint for pointopoint interfaces.
115 may be followed by a slash and a decimal number, encoding the network
116 prefix length. If a peer address is specified, the local address
117 cannot have a prefix length. The network prefix is associated
118 with the peer rather than with the local address.
121 .BI broadcast " ADDRESS"
122 the broadcast address on the interface.
124 It is possible to use the special symbols
128 instead of the broadcast address. In this case, the broadcast address
129 is derived by setting/resetting the host bits of the interface prefix.
133 Each address may be tagged with a label string.
134 In order to preserve compatibility with Linux-2.0 net aliases,
135 this string must coincide with the name of the device or must be prefixed
136 with the device name followed by colon.
139 .BI scope " SCOPE_VALUE"
140 the scope of the area where this address is valid.
141 The available scopes are listed in file
142 .BR "/etc/iproute2/rt_scopes" .
143 Predefined scope values are:
147 - the address is globally valid.
150 - the address is link local, i.e. it is valid only on this device.
153 - the address is valid only inside this host.
158 (IPv6 only) the valid lifetime of this address; see section 5.5.4 of
159 RFC 4862. Defaults to
163 .BI preferred_lft " LFT"
164 (IPv6 only) the preferred lifetime of this address; see section 5.5.4
165 of RFC 4862. Defaults to
170 (IPv6 only) designates this address the "home address" as defined in
175 (IPv6 only) do not perform Duplicate Address Detection (RFC 4862) when
178 .SS ip address delete - delete protocol address
180 coincide with the arguments of
182 The device name is a required argument. The rest are optional.
183 If no arguments are given, the first address is deleted.
185 .SS ip address show - look at protocol addresses
188 .BI dev " NAME " (default)
192 .BI scope " SCOPE_VAL"
193 only list addresses with this scope.
197 only list addresses matching this prefix.
201 only list addresses with labels matching the
204 is a usual shell style pattern.
207 .BR dynamic " and " permanent
208 (IPv6 only) only list addresses installed due to stateless
209 address configuration or only list permanent (not dynamic)
214 (IPv6 only) only list addresses which have not yet passed duplicate
219 (IPv6 only) only list deprecated addresses.
223 (IPv6 only) only list addresses which have failed duplicate
228 (IPv6 only) only list temporary addresses.
231 .BR primary " and " secondary
232 only list primary (or secondary) addresses.
234 .SS ip address flush - flush protocol addresses
235 This command flushes the protocol addresses selected by some criteria.
238 This command has the same arguments as
240 The difference is that it does not run when no arguments are given.
244 This command and other
246 commands are unforgiving. They will cruelly purge all the addresses.
251 option, the command becomes verbose. It prints out the number of deleted
252 addresses and the number of rounds made to flush the address list.
253 If this option is given twice,
255 also dumps all the deleted addresses in the format described in the
260 ip address show dev eth0
262 Shows the addresses assigned to network interface eth0
265 ip addr add 2001:0db8:85a3::0370:7334/64 dev eth1
267 Adds an IPv6 address to network interface eth1
270 ip addr flush dev eth4
272 Removes all addresses from device eth4
280 Original Manpage by Michail Litvak <mci@owl.openwall.com>