Linux "ip-address" Command Line Options and Examples
protocol address management

The address is a protocol (IPv4 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.


Usage:

ip [ OPTIONS ] address { COMMAND | help }




Command Line Options:

-tentative
(IPv6 only) only list addresses which are not in the process of duplicate address detection currently.deprecated(IPv6 only) only list deprecated addresses.
ip-address -tentative ...
-deprecated
(IPv6 only) only list addresses not being deprecated.dadfailed(IPv6 only) only list addresses which have failed duplicate address detection.
ip-address -deprecated ...
-dadfailed
(IPv6 only) only list addresses which have not failed duplicate address detection.temporary(IPv6 only) only list temporary addresses.primary and secondaryonly list primary (or secondary) addresses.ip address flush - flush protocol addressesThis command flushes the protocol addresses selected by some criteria.This command has the same arguments as show except that type and master selectors are not supported. Another difference is that itdoes not run when no arguments are given.Warning: This command and other flush commands are unforgiving. They 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 madeto flush the address list. If this option is given twice, ip address flush also dumps all the deleted addresses in the formatdescribed in the previous subsection.EXAMPLESip address showShows IPv4 and IPv6 addresses assigned to all network interfaces. The 'show' subcommand can be omitted.ip address show upSame as above except that only addresses assigned to active network interfaces are shown.ip address show dev eth0Shows IPv4 and IPv6 addresses assigned to network interface eth0.ip address add 2001:0db8:85a3::0370:7334/64 dev eth1Adds an IPv6 address to network interface eth1.ip address delete 2001:0db8:85a3::0370:7334/64 dev eth1Delete the IPv6 address added above.ip address flush dev eth4 scope globalRemoves all global IPv4 and IPv6 addresses from device eth4. Without 'scope global' it would remove all addresses including IPv6link-local ones.
ip-address -dadfailed ...