next up previous contents
Next: ip address flush Up: ip address show Previous: Arguments:   Contents

Output format:

kuznet@alisa:~ $ ip addr ls eth0
3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc cbq qlen 100
    link/ether 00:a0:cc:66:18:78 brd ff:ff:ff:ff:ff:ff
    inet 193.233.7.90/24 brd 193.233.7.255 scope global eth0
    inet6 3ffe:2400:0:1:2a0:ccff:fe66:1878/64 scope global dynamic 
       valid_lft forever preferred_lft 604746sec
    inet6 fe80::2a0:ccff:fe66:1878/10 scope link 
kuznet@alisa:~ $

The first two lines coincide with the output of ip link ls. It is natural to interpret link layer addresses as addresses of the protocol family AF_PACKET.

Then the list of IP and IPv6 addresses follows, accompanied by additional address attributes: scope value (see Sec.5.1, p.[*] above), flags and the address label.

Address flags are set by the kernel and cannot be changed administratively. Currently, the following flags are defined:

  1. secondary

    -- the address is not used when selecting the default source address of outgoing packets (Cf. Appendix A, p.[*].). An IP address becomes secondary if another address with the same prefix bits already exists. The first address is primary. It is the leader of the group of all secondary addresses. When the leader is deleted, all secondaries are purged too. There is a tweak in /proc/sys/net/ipv4/conf/<dev>/promote_secondaries which activate secondaries promotion when a primary is deleted. To permanently enable this feature on all devices add net.ipv4.conf.all.promote_secondaries=1 to /etc/sysctl.conf. This tweak is available in linux 2.6.15 and later.

  2. dynamic

    -- the address was created due to stateless autoconfiguration [2]. In this case the output also contains information on times, when the address is still valid. After preferred_lft expires the address is moved to the deprecated state. After valid_lft expires the address is finally invalidated.

  3. deprecated

    -- the address is deprecated, i.e. it is still valid, but cannot be used by newly created connections.

  4. tentative

    -- the address is not used because duplicate address detection [2] is still not complete or failed.


next up previous contents
Next: ip address flush Up: ip address show Previous: Arguments:   Contents