1 .TH "IP\-ADDRESS" 8 "20 Dec 2011" "iproute2" "Linux"
3 ip-address \- protocol address management
12 .RI " { " COMMAND " | "
17 .BR "ip address" " { " add " | " del " } "
18 .IB IFADDR " dev " STRING
21 .BR "ip address" " { " show " | " flush " } [ " dev
26 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
31 .IR IFADDR " := " PREFIX " | " ADDR
45 .RB "[ " host " | " link " | " global " | "
49 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
53 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
54 tentative " | " deprecated " | " dadfailed " | " temporary " ]"
59 is a protocol (IP or IPv6) address attached
60 to a network device. Each device must have at least one address
61 to use the corresponding protocol. It is possible to have several
62 different addresses attached to one device. These addresses are not
63 discriminated, so that the term
65 is not quite appropriate for them and we do not use it in this document.
69 command displays addresses and their properties, adds new addresses
72 .SS ip address add - add new protocol address.
76 the name of the device to add the address to.
79 .BI local " ADDRESS " (default)
80 the address of the interface. The format of the address depends
81 on the protocol. It is a dotted quad for IP and a sequence of
82 hexadecimal halfwords separated by colons for IPv6. The
84 may be followed by a slash and a decimal number which encodes
85 the network prefix length.
89 the address of the remote endpoint for pointopoint interfaces.
92 may be followed by a slash and a decimal number, encoding the network
93 prefix length. If a peer address is specified, the local address
94 cannot have a prefix length. The network prefix is associated
95 with the peer rather than with the local address.
98 .BI broadcast " ADDRESS"
99 the broadcast address on the interface.
101 It is possible to use the special symbols
105 instead of the broadcast address. In this case, the broadcast address
106 is derived by setting/resetting the host bits of the interface prefix.
110 Each address may be tagged with a label string.
111 In order to preserve compatibility with Linux-2.0 net aliases,
112 this string must coincide with the name of the device or must be prefixed
113 with the device name followed by colon.
116 .BI scope " SCOPE_VALUE"
117 the scope of the area where this address is valid.
118 The available scopes are listed in file
119 .BR "@SYSCONFDIR@/rt_scopes" .
120 Predefined scope values are:
124 - the address is globally valid.
127 - (IPv6 only) the address is site local, i.e. it is
128 valid inside this site.
131 - the address is link local, i.e. it is valid only on this device.
134 - the address is valid only inside this host.
137 .SS ip address delete - delete protocol address
139 coincide with the arguments of
141 The device name is a required argument. The rest are optional.
142 If no arguments are given, the first address is deleted.
144 .SS ip address show - look at protocol addresses
147 .BI dev " NAME " (default)
151 .BI scope " SCOPE_VAL"
152 only list addresses with this scope.
156 only list addresses matching this prefix.
160 only list addresses with labels matching the
163 is a usual shell style pattern.
166 .BR dynamic " and " permanent
167 (IPv6 only) only list addresses installed due to stateless
168 address configuration or only list permanent (not dynamic)
173 (IPv6 only) only list addresses which have not yet passed duplicate
178 (IPv6 only) only list deprecated addresses.
182 (IPv6 only) only list addresses which have failed duplicate
187 (IPv6 only) only list temporary addresses.
190 .BR primary " and " secondary
191 only list primary (or secondary) addresses.
193 .SS ip address flush - flush protocol addresses
194 This command flushes the protocol addresses selected by some criteria.
197 This command has the same arguments as
199 The difference is that it does not run when no arguments are given.
203 This command (and other
205 commands described below) is pretty dangerous. If you make a mistake,
206 it will not forgive it, but will cruelly purge all the addresses.
211 option, the command becomes verbose. It prints out the number of deleted
212 addresses and the number of rounds made to flush the address list. If
213 this option is given twice,
215 also dumps all the deleted addresses in the format described in the
220 ip address show dev eth0
222 Shows the addresses assigned to network interface eth0
225 ip addr add 2001:0db8:85a3::0370:7334/64 dev eth1
227 Adds an IPv6 address to network interface eth1
230 ip addr flush dev eth4
232 Removes all addresses from device eth4
240 Original Manpage by Michail Litvak <mci@owl.openwall.com>