ip-address
protocol address management
- Provided by: iproute2 (Version: 3.12.0-2ubuntu1.2)
- Report a bug
protocol address management
ip [ OPTIONS ] address { COMMAND | help }
ip address { add | del } IFADDR dev STRING
ip address { show | flush } [ dev STRING ] [ scope SCOPE-ID ] [ to PREFIX ] [ FLAG-LIST ] [ label PATTERN ]
IFADDR := PREFIX | ADDR peer PREFIX [ broadcast ADDR ] [ anycast ADDR ] [ label STRING ] [ scope SCOPE-ID ]
SCOPE-ID := [ host | link | global | NUMBER ]
FLAG-LIST := [ FLAG-LIST ] FLAG
FLAG := [ permanent | dynamic | secondary | primary | tentative | deprecated | dadfailed | temporary ]
The address is a protocol (IP or IPv6) address attached to a network device. Each device must have at least one address to use the corresponding protocol. It is possible to have several different addresses attached to one device. These addresses are not discriminated, so that the term alias is not quite appropriate for them and we do not use it in this document.
The ip address command displays addresses and their properties, adds new addresses and deletes old ones.
It is possible to use the special symbols '+' and '-' instead of the broadcast address. In this case, the broadcast address is derived by setting/resetting the host bits of the interface prefix.
global - the address is globally valid.
site - (IPv6 only) the address is site local, i.e. it is valid inside this site.
link - the address is link local, i.e. it is valid only on this device.
host - the address is valid only inside this host.
Arguments: coincide with the arguments of ip addr add. The device name is a required argument. The rest are optional. If no arguments are given, the first address is deleted.
This command flushes the protocol addresses selected by some criteria.
This command has the same arguments as show. The difference is that it does not run when no arguments are given.
Warning: This command (and other flush commands described below) is pretty dangerous. If you make a mistake, it will not forgive it, but will cruelly purge all the addresses.
With the -statistics option, the command becomes verbose. It prints out the number of deleted addresses and the number of rounds made to flush the address list. If this option is given twice, ip address flush also dumps all the deleted addresses in the format described in the previous subsection.
ip address show dev eth0
ip addr add 2001:0db8:85a3::0370:7334/64 dev eth1
ip addr flush dev eth4
Original Manpage by Michail Litvak <mci@owl.openwall.com>