Octet

Walk me through the output of ip addr show. What do UP, LOWER_UP and state mean?

Show the answer

Say this first

The flags in angle brackets are what the interface is configured and able to do: UP means administratively up, LOWER_UP means the driver sees carrier (layer 1 is up). state is the operational state the kernel computed: UP, DOWN, or UNKNOWN for things like loopback that do not report carrier. Then come the MTU, the queueing discipline, the MAC, and each address with its prefix, scope and lifetime.

Go deeper

A real example

Output
$ ip addr show dev ens192
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:a1:2b:3c brd ff:ff:ff:ff:ff:ff
    inet 10.0.10.21/24 brd 10.0.10.255 scope global dynamic ens192
       valid_lft 85912sec preferred_lft 85912sec
    inet6 fe80::250:56ff:fea1:2b3c/64 scope link
       valid_lft forever preferred_lft forever
  • 2: is the interface index. Other commands refer to it (for example veth0@if7).
  • UP admin up, LOWER_UP carrier present. A cable pull shows NO-CARRIER and state DOWN while UP stays, because the admin state did not change.
  • mtu 1500, qdisc mq (multiqueue NIC), qlen 1000 is the transmit queue length.
  • inet 10.0.10.21/24 brd 10.0.10.255 scope global dynamic: address with prefix, broadcast, scope global (routable), and dynamic means it came from DHCP; valid_lft counts down the lease.
  • inet6 fe80::.../64 scope link is the IPv6 link-local address, built here from the MAC with EUI-64.

Scopes

global is usable anywhere, link only on this link (fe80::, 169.254/16), host only inside this machine (127.0.0.1 on lo).

The short form

Output
$ ip -br addr
lo               UNKNOWN        127.0.0.1/8 ::1/128
ens192           UP             10.0.10.21/24 fe80::250:56ff:fea1:2b3c/64

Traps

  • Reading LOWER_UP as "the interface is enabled". It only means carrier is present.
  • Ignoring dynamic and valid_lft. A DHCP address with a short lifetime left can explain intermittent loss.
How did you do?