| | |

LFCA 42 ๐Ÿง Viewing Network Interfaces โ€” ip addr, ip link

A network interface is the device’s connection to a network. It can be a physical card, a wireless adapter, a virtual interface, a bridge, a tunnel, or a loopback. Each has an address, a state, a set of statistics, and a set of properties. The tools for viewing them are the ip addr and the ip link commands, which are the modern replacements for the ifconfig and the netstat of the old net-tools package. The two commands cover different layers: ip link shows the link layer โ€” the interface’s state, the MAC address, the MTU โ€” and ip addr shows the network layer โ€” the IP addresses, the prefixes, the scopes. Together they are the first step in any network diagnosis, and the ip -s link adds the statistics that reveal the errors and the drops. This chapter covers the interface types, the ip link output, the ip addr output, the state flags, the statistics, the multiple addresses, and the patterns that make the interface inspection systematic. It is the practical companion to LFCA 39 through 41 and prepares the ground for the network diagnostics.

Key point: The ip link command shows the link-layer information: the interface name, the state (UP, DOWN, UNKNOWN), the MTU, the MAC address, and the flags. The ip addr command shows the network-layer information: the IP addresses, the prefixes, the broadcast addresses, the scopes, and the interface’s state. The two commands together are the complete picture of an interface. The ip -s link adds the statistics: the received and transmitted bytes, packets, errors, and drops. The interface names follow the predictable pattern: the eth0 for the Ethernet, the wlan0 for the wireless, the lo for the loopback, the docker0 for the Docker bridge, the tun0 for the tunnel. The ip link set and the ip addr add are the configuration, but the inspection is the focus here.


The interface types

A network interface is a device that connects to a network. The types are the physical, the virtual, and the special.

The physical interfaces. The Ethernet card is the eth0 or the enp3s0, the wireless adapter is the wlan0 or the wlp2s0. The names are the physical, and the kernel assigns them at the boot. The modern systemd’s predictable names โ€” the enp3s0 and the wlp2s0 โ€” are based on the PCI slot, and the legacy names โ€” the eth0 and the wlan0 โ€” are the sequential.

The loopback. The lo is the loopback, and it is always present. The address is the 127.0.0.1/8 (the IPv4) and the ::1/128 (the IPv6). The loopback is for the local communication, and the traffic does not leave the device.

The virtual interfaces. The docker0 is the Docker bridge, the virbr0 is the libvirt bridge, the tun0 is the OpenVPN tunnel, the wg0 is the WireGuard, the br0 is the custom bridge. The virtual interfaces are the software, and the kernel creates them.

The VLAN interfaces. The eth0.100 is the VLAN 100 on the eth0, and the naming is the parent and the VLAN ID. The VLAN is the tag, and the kernel handles the tagging.

The bond interfaces. The bond0 is the bond of the two or more interfaces, and the pattern is the redundancy or the aggregation. The bond is the virtual, and the members are the physical.

Why the interface types matter. Each type has the specific behavior and the specific configuration. The physical interface is the hardware, the virtual is the software, and the loopback is the special. The diagnosis is the type-specific, and the knowledge of the types is the fluency.

Why the names are the predictable. The modern names are the predictable, and the legacy are the sequential. The predictable names are the stable across the reboots, and the legacy can change. The stable names are the better, and the systemd’s naming is the modern.

Why the interface can be the multiple. A device can have the multiple interfaces โ€” the Ethernet and the wireless, the physical and the virtual, the VLAN and the bridge. Each has its own address, and the routing table decides which is the outgoing.

Why the ip link and the ip addr are the pair. The ip link is the link layer, and the ip addr is the network layer. The two are the different layers, and the two together are the complete picture. The ip link is the state and the MAC, and the ip addr is the IP and the prefix. The diagnosis uses both.


The ip link command

The ip link command shows the link-layer information for every interface. The output includes the interface name, the state, the MTU, and the MAC address.

ip link
# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
#     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
#     link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
# 3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
#     link/ether 11:22:33:44:55:66 brd ff:ff:ff:ff:ff:ff

The three interfaces: the loopback, the Ethernet, and the wireless. The Ethernet is UP, and the wireless is DOWN.

The interface index. The 1:, the 2:, the 3: are the interface indexes. The index is the kernel’s number, and the lo is always the 1.

The interface name. The lo, the eth0, the wlan0 are the names. The name is the identifier, and the ip commands use it.

The flags. The <LOOPBACK,UP,LOWER_UP> is the flags. The LOOPBACK is the loopback, the UP is the administratively up, the LOWER_UP is the carrier present, the BROADCAST is the broadcast capable, the MULTICAST is the multicast capable.

Why the UP and the LOWER_UP are different. The UP is the administrative state โ€” the interface is enabled. The LOWER_UP is the physical state โ€” the cable is connected, the carrier is present. The UP without the LOWER_UP means the interface is enabled but the cable is unplugged.

The MTU. The mtu 1500 is the Maximum Transmission Unit, the largest packet the interface can send. The Ethernet’s default is the 1500, and the loopback’s is the 65536.

Why the MTU matters. A packet larger than the MTU must be fragmented, and the fragmentation is the overhead. The wrong MTU causes the performance problems, and the mtu 1500 is the standard.

The qdisc. The qdisc fq_codel is the queueing discipline, which is the kernel’s packet scheduling. The fq_codel is the modern default, and the noqueue is the loopback’s.

The state. The state UP, the state DOWN, the state UNKNOWN are the interface’s state. The UP is the running, the DOWN is the disabled, and the UNKNOWN is the loopback’s (which has no carrier).

The mode and the group. The mode DEFAULT and the group default are the mode and the group. The mode is the interface’s mode, and the group is the grouping.

The qlen. The qlen 1000 is the transmit queue length, which is the number of the packets the queue can hold. The 1000 is the default.

The link line. The link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff is the link layer. The link/ether is the Ethernet, the aa:bb:cc:dd:ee:ff is the MAC address, and the brd ff:ff:ff:ff:ff:ff is the broadcast address.

Why the MAC matters. The MAC is the hardware address, and it is the unique on the local network. The ARP maps the IP to the MAC, and the packet is sent to the MAC. The MAC is the link layer’s identity.

The ip link show <interface>. The command with the interface shows only that interface.

ip link show eth0

Why the single interface is the focus. The command with the interface is the focused, and the output is the specific. The pattern is the diagnosis, and the use is the common.


The ip addr command

The ip addr command shows the network-layer information for every interface. The output includes the IP addresses, the prefixes, the scopes, and the states.

ip addr
# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
#     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
#     inet 127.0.0.1/8 scope host lo
#        valid_lft forever preferred_lft forever
#     inet6 ::1/128 scope host
#        valid_lft forever preferred_lft forever
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
#     link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
#     inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
#        valid_lft 86350sec preferred_lft 86350sec
#     inet6 fe80::a00:27ff:fe4e:66a1/64 scope link
#        valid_lft forever preferred_lft forever
# 3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
#     link/ether 11:22:33:44:55:66 brd ff:ff:ff:ff:ff:ff

The output shows the link layer and the network layer. The inet lines are the IPv4 addresses, and the inet6 lines are the IPv6 addresses.

The inet line. The inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0 is the IPv4 address. The 192.168.1.100 is the address, the /24 is the prefix, the brd 192.168.1.255 is the broadcast, the scope global is the scope, the dynamic is the DHCP-assigned, and the eth0 is the interface.

Why the scope matters. The scope global is the globally routable, the scope link is the link-local (the 169.254.x.x or the fe80::), the scope host is the loopback. The scope is the address’s reach, and the diagnosis uses the scope.

The dynamic flag. The dynamic means the address was assigned by the DHCP, and the valid_lft and the preferred_lft are the lease’s timers. The valid_lft 86350sec is the lease’s remaining time, and the preferred_lft is the preferred time.

Why the lease’s timers matter. The DHCP’s lease is the time-limited, and the address is the renewed before the valid_lft expires. The 86350sec is the ~24 hours, and the client renews at the half.

The inet6 line. The inet6 fe80::a00:27ff:fe4e:66a1/64 scope link is the IPv6 link-local. The fe80:: is the link-local prefix, and the /64 is the prefix length.

Why the link-local is present. The IPv6 interface always has the link-local address, and it is the fe80::/10. The address is the automatic, and the pattern is the neighbor discovery.

The ip -4 addr. The -4 shows only the IPv4.

ip -4 addr

The ip -6 addr. The -6 shows only the IPv6.

ip -6 addr

Why the family filter matters. The -4 and the -6 are the family filters, and the focused output is the diagnosis. The pattern is the common, and the use is the specific.

The ip addr show <interface>. The command with the interface shows only that interface.

ip addr show eth0

The ip addr show dev <interface>. The dev is the explicit, and the two are the same.

ip addr show dev eth0

Why the interface filter matters. The single interface’s output is the focused, and the diagnosis is the specific. The pattern is the common, and the use is the interface.


The state flags

The flags in the <> describe the interface’s capabilities and the state. The common flags are the UP, the LOWER_UP, the BROADCAST, the MULTICAST, the LOOPBACK, the NOARP, the PROMISC, the ALLMULTI.

The UP. The UP is the administratively up, which means the interface is enabled.

The LOWER_UP. The LOWER_UP is the carrier present, which means the cable is connected (or the wireless is associated).

Why the UP without the LOWER_UP is the problem. The interface is enabled but the carrier is absent, which means the cable is unplugged or the switch’s port is down. The pattern is the physical, and the diagnosis is the cable.

The DOWN. The state DOWN is the interface disabled. The ip link set eth0 down is the disable, and the ip link set eth0 up is the enable.

The BROADCAST. The BROADCAST is the broadcast capable. The Ethernet is the broadcast, and the loopback is not.

The MULTICAST. The MULTICAST is the multicast capable. The Ethernet is the multicast, and the loopback is not.

The LOOPBACK. The LOOPBACK is the loopback interface. The lo has the flag, and the others do not.

The NOARP. The NOARP is the ARP disabled. The pattern is the tunnel, and the use is the specific.

The PROMISC. The PROMISC is the promiscuous mode, which means the interface receives every packet on the segment, not just the ones addressed to it. The tcpdump uses the promiscuous, and the pattern is the capture.

Why the promiscuous matters. The promiscuous mode is the packet capture, and the tcpdump and the wireshark use it. The flag is the diagnostic, and the use is the specific.

The ALLMULTI. The ALLMULTI is the all-multicast, which means the interface receives every multicast packet. The pattern is the specific, and the use is the rare.

The SLAVE. The SLAVE is the bond’s member, and the pattern is the bond. The bond’s members have the flag, and the bond has the MASTER.

The MASTER. The MASTER is the bond’s master, and the pattern is the bond. The bond has the flag, and the members have the SLAVE.

Why the flags are the diagnosis. The flags describe the interface’s state and the capabilities. The UP and the LOWER_UP are the state, the BROADCAST and the MULTICAST are the capabilities, and the PROMISC and the SLAVE are the specific. The flags are the first thing to check.


The statistics

The ip -s link shows the statistics for every interface. The statistics include the received and transmitted bytes, packets, errors, and drops.

ip -s link
# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
#     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
#     RX:  bytes packets errors dropped  missed   mcast
#       12345     100      0       0       0       0
#     TX:  bytes packets errors dropped carrier collsns
#       12345     100      0       0       0       0
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
#     link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
#     RX:  bytes packets errors dropped  missed   mcast
#       1234567   12345      0       0       0     100
#     TX:  bytes packets errors dropped carrier collsns
#       7654321   12345      0       0       0       0

The RX is the received, and the TX is the transmitted. The errors, the dropped, the missed, and the carrier are the specific.

The RX errors. The errors is the number of the receive errors, which is the hardware or the driver’s. The pattern is the cable or the card, and the diagnosis is the physical.

The RX dropped. The dropped is the number of the dropped packets, which is the kernel’s (the buffer full, the no memory). The pattern is the load, and the diagnosis is the resource.

The RX missed. The missed is the number of the missed packets, which is the ring buffer’s. The pattern is the interrupt, and the diagnosis is the kernel.

The RX mcast. The mcast is the number of the multicast packets.

The TX errors. The errors is the number of the transmit errors.

The TX dropped. The dropped is the number of the dropped packets.

The TX carrier. The carrier is the number of the carrier losses.

The TX collsns. The collsns is the number of the collisions, which is the half-duplex or the duplex mismatch.

Why the collisions matter. The collisions are the half-duplex or the duplex mismatch, and the modern Ethernet is the full-duplex. The collisions indicate the duplex mismatch, and the diagnosis is the switch’s port.

The ip -s -s link. The -s -s shows the more detailed statistics, which is the errors’ breakdown.

ip -s -s link show eth0

Why the statistics matter. The statistics reveal the errors and the drops, which the state alone does not. The interface can be UP and still have the errors, and the statistics are the diagnosis.

Why the statistics should be the baseline. The statistics are the cumulative since the boot, and the baseline is the comparison. The increase over the time is the rate, and the rate is the diagnosis.

Why the statistics should be the periodic. The periodic check is the monitoring, and the increase is the alert. The pattern is the proactive, and the use is the production.


The multiple addresses

An interface can have the multiple addresses โ€” the multiple IPv4, the multiple IPv6, the mixed. The pattern is the secondary, and the use is the specific.

ip addr show eth0
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
#     link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
#     inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
#     inet 192.168.1.101/24 brd 192.168.1.255 scope global secondary eth0
#     inet6 fe80::a00:27ff:fe4e:66a1/64 scope link

The 192.168.1.100 is the primary, and the 192.168.1.101 is the secondary. The secondary flag marks the additional.

Why the multiple addresses exist. The multiple addresses are the multiple networks, the migration, the virtual hosting. The pattern is the specific, and the use is the advanced.

Why the primary and the secondary. The primary is the first, and the secondary is the additional. The kernel picks the primary for the outgoing, and the secondary is the alias.

Why the multiple IPv6 are common. The IPv6 interface has the link-local and the global, and the two are the common. The pattern is the standard, and the use is the IPv6.

Why the address can be the temporary. The IPv6 privacy extensions add the temporary address, which is the rotated for the privacy. The pattern is the privacy, and the use is the modern.

Why the address’s valid_lft matters. The valid_lft is the address’s lifetime, and the forever is the static. The dynamic is the DHCP’s, and the deprecated is the IPv6’s.

Why the address can be the deprecated. The IPv6’s deprecated address is the valid but not the preferred, and the new connections use the new address. The pattern is the transition, and the use is the IPv6.

Why the multiple addresses are the diagnosis. The multiple addresses mean the interface has the multiple networks, and the routing table has the multiple routes. The diagnosis is the address-specific, and the ip addr is the source.

Why the ip addr add and the ip addr del. The ip addr add 192.168.1.101/24 dev eth0 adds the address, and the ip addr del removes it. The pattern is the temporary, and the persistence is the configuration’s.


Complete Example Session

# ============================================
# PART 1: THE IP LINK
# ============================================

ip link
# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
#     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
#     link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
# 3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
#     link/ether 11:22:33:44:55:66 brd ff:ff:ff:ff:ff:ff

# ============================================
# PART 2: THE IP ADDR
# ============================================

ip addr
# 1: lo: <LOOPBACK,UP,LOWER_UP>
#     inet 127.0.0.1/8 scope host lo
#     inet6 ::1/128 scope host
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>
#     inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
#     inet6 fe80::a00:27ff:fe4e:66a1/64 scope link
# 3: wlan0: <BROADCAST,MULTICAST>
#     (no addresses, the interface is down)

# ============================================
# PART 3: THE SPECIFIC INTERFACE
# ============================================

ip link show eth0
ip addr show eth0

# ============================================
# PART 4: THE FAMILY FILTER
# ============================================

ip -4 addr
ip -6 addr

# ============================================
# PART 5: THE STATISTICS
# ============================================

ip -s link
# 2: eth0: ...
#     RX:  bytes packets errors dropped  missed   mcast
#       1234567   12345      0       0       0     100
#     TX:  bytes packets errors dropped carrier collsns
#       7654321   12345      0       0       0       0

ip -s -s link show eth0

# ============================================
# PART 6: THE FLAGS
# ============================================

# <LOOPBACK>     the loopback
# <UP>           the administrative up
# <LOWER_UP>     the carrier present
# <BROADCAST>    the broadcast capable
# <MULTICAST>    the multicast capable
# <PROMISC>      the promiscuous mode
# <SLAVE>        the bond member
# <MASTER>       the bond master

# ============================================
# PART 7: THE STATE
# ============================================

# state UP       the running
# state DOWN     the disabled
# state UNKNOWN  the loopback (no carrier)

# ============================================
# PART 8: THE MULTIPLE ADDRESSES
# ============================================

ip addr add 192.168.1.101/24 dev eth0
ip addr show eth0
#     inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
#     inet 192.168.1.101/24 brd 192.168.1.255 scope global secondary eth0

ip addr del 192.168.1.101/24 dev eth0

# ============================================
# PART 9: THE DIAGNOSIS
# ============================================

# 1. ip link         โ†’ the state and the MAC
# 2. ip addr         โ†’ the addresses and the prefixes
# 3. ip -s link      โ†’ the errors and the drops
# 4. ip route        โ†’ the routes
# 5. ping the gateway

# The UP without the LOWER_UP โ†’ the cable is unplugged.
# The DOWN โ†’ the interface is disabled.
# The errors โ†’ the hardware or the driver.
# The dropped โ†’ the buffer or the load.

# ============================================
# PART 10: WHAT NOT TO DO
# ============================================

# Don't use the ifconfig (the legacy)
# The ip is the modern.

# Don't assume the UP means the connected
# The LOWER_UP is the carrier.

# Don't ignore the errors and the drops
# The statistics reveal the problems.

# Don't forget the family filter
# The -4 and the -6 are the focused.

# Don't add the address without the prefix
# The ip addr add 192.168.1.101  # the prefix is required

# Don't forget the persistence
# The ip addr add is temporary.

The ten parts cover the ip link, the ip addr, the specific interface, the family filter, the statistics, the flags, the state, the multiple addresses, the diagnosis, and the anti-patterns.


Quick Reference

The Commands

CommandPurpose
ip linkThe link layer
ip addrThe network layer
ip -4 addrThe IPv4 only
ip -6 addrThe IPv6 only
ip link show <if>One interface’s link
ip addr show <if>One interface’s addresses
ip -s linkThe statistics
ip -s -s linkThe detailed statistics

The ip link Fields

FieldMeaning
The indexThe kernel’s number
The nameThe identifier
The flagsThe capabilities and the state
The MTUThe maximum transmission unit
The qdiscThe queueing discipline
The stateThe UP, DOWN, UNKNOWN
The linkThe MAC and the broadcast

The ip addr Fields

FieldMeaning
inetThe IPv4
inet6The IPv6
The addressThe IP
The prefixThe /24
brdThe broadcast
scopeThe global, link, host
dynamicThe DHCP
valid_lftThe lease’s lifetime

The Flags

FlagMeaning
UPThe administrative up
LOWER_UPThe carrier present
DOWNThe disabled
BROADCASTThe broadcast capable
MULTICASTThe multicast capable
LOOPBACKThe loopback
PROMISCThe promiscuous
SLAVEThe bond member
MASTERThe bond master

The Statistics

CounterMeaning
The bytesThe total
The packetsThe total
The errorsThe hardware or the driver
The droppedThe buffer or the load
The missedThe ring buffer
The carrierThe carrier losses
The collsnsThe collisions

The Common Scopes

ScopeMeaning
globalThe globally routable
linkThe link-local
hostThe loopback

Best Practices

โœ… Do This:

# Use the ip commands
ip link
ip addr                                                        # โœ…

# Check the specific interface
ip addr show eth0                                              # โœ…

# Use the family filter
ip -4 addr                                                     # โœ…

# Check the statistics
ip -s link                                                     # โœ…

# Check the carrier
# The UP without the LOWER_UP means the cable is unplugged.    # โœ…

# Check the errors and the drops
ip -s link show eth0                                           # โœ…

# Check the multiple addresses
ip addr show eth0                                              # โœ…

โŒ Don’t Do This:

# Don't use the ifconfig
ifconfig  # the legacy                                         # โš ๏ธ

# Don't assume the UP means the connected
# The LOWER_UP is the carrier.                                # โš ๏ธ

# Don't ignore the errors and the drops
# The statistics reveal the problems.                         # โš ๏ธ

# Don't add the address without the prefix
ip addr add 192.168.1.101  # the prefix is required            # โš ๏ธ

# Don't forget the persistence
# The ip addr add is temporary.                               # โš ๏ธ

# Don't forget the family filter
# The -4 and the -6 are the focused.                          # โš ๏ธ

Common Pitfalls

PitfallProblemSolution
The UP without the LOWER_UPThe cable is unpluggedCheck the cable
The DOWN stateThe interface is disabledip link set up
The errorsThe hardwareCheck the cable and the card
The droppedThe bufferCheck the load
The collisionsThe duplex mismatchCheck the switch
The missing prefixThe invalidAdd the /24
The temporary addressLost at rebootPersist it
The ifconfigThe legacyUse ip

Real-World Examples

1. The interfaces

ip link

2. The addresses

ip addr

3. The specific interface

ip addr show eth0

4. The IPv4 only

ip -4 addr

5. The statistics

ip -s link

6. The carrier check

ip link show eth0
# Look for the LOWER_UP flag.

7. The multiple addresses

ip addr add 192.168.1.101/24 dev eth0

8. The errors

ip -s link show eth0

9. The state

ip link show eth0 | grep -o 'state [A-Z]*'

10. The MAC

ip link show eth0 | grep link/ether

Visual: The ip link

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>              โ”‚
โ”‚  โ”‚  โ”‚     โ”‚                    โ”‚  โ”‚                      โ”‚
โ”‚  โ”‚  โ”‚     โ”‚                    โ”‚  โ””โ”€โ”€ the carrier presentโ”‚
โ”‚  โ”‚  โ”‚     โ”‚                    โ””โ”€โ”€ the administrative up โ”‚
โ”‚  โ”‚  โ”‚     โ””โ”€โ”€ the multicast capable                      โ”‚
โ”‚  โ”‚  โ””โ”€โ”€ the interface name                               โ”‚
โ”‚  โ””โ”€โ”€ the interface index                                 โ”‚
โ”‚                                                          โ”‚
โ”‚  mtu 1500 qdisc fq_codel state UP                        โ”‚
โ”‚  โ”‚         โ”‚              โ”‚                              โ”‚
โ”‚  โ”‚         โ”‚              โ””โ”€โ”€ the state                  โ”‚
โ”‚  โ”‚         โ””โ”€โ”€ the queueing discipline                   โ”‚
โ”‚  โ””โ”€โ”€ the maximum transmission unit                       โ”‚
โ”‚                                                          โ”‚
โ”‚  link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff      โ”‚
โ”‚  โ”‚          โ”‚                  โ”‚                         โ”‚
โ”‚  โ”‚          โ”‚                  โ””โ”€โ”€ the broadcast         โ”‚
โ”‚  โ”‚          โ””โ”€โ”€ the MAC address                          โ”‚
โ”‚  โ””โ”€โ”€ the Ethernet                                        โ”‚
โ”‚                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: The ip addr

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0โ”‚
โ”‚  โ”‚    โ”‚              โ”‚   โ”‚                โ”‚      โ”‚       โ”‚
โ”‚  โ”‚    โ”‚              โ”‚   โ”‚                โ”‚      โ”‚       โ””โ”€โ”€ the interfaceโ”‚
โ”‚  โ”‚    โ”‚              โ”‚   โ”‚                โ”‚      โ””โ”€โ”€ the DHCP-assignedโ”‚
โ”‚  โ”‚    โ”‚              โ”‚   โ”‚                โ””โ”€โ”€ the scope  โ”‚
โ”‚  โ”‚    โ”‚              โ”‚   โ””โ”€โ”€ the broadcast               โ”‚
โ”‚  โ”‚    โ”‚              โ””โ”€โ”€ the prefix                      โ”‚
โ”‚  โ”‚    โ””โ”€โ”€ the IPv4 address                               โ”‚
โ”‚  โ””โ”€โ”€ the address family                                 โ”‚
โ”‚                                                          โ”‚
โ”‚  inet6 fe80::a00:27ff:fe4e:66a1/64 scope link           โ”‚
โ”‚  โ”‚     โ”‚                          โ”‚    โ”‚                โ”‚
โ”‚  โ”‚     โ”‚                          โ”‚    โ””โ”€โ”€ the link scopeโ”‚
โ”‚  โ”‚     โ”‚                          โ””โ”€โ”€ the prefix         โ”‚
โ”‚  โ”‚     โ””โ”€โ”€ the IPv6 link-local                          โ”‚
โ”‚  โ””โ”€โ”€ the IPv6 family                                    โ”‚
โ”‚                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: The State Flags

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  <LOOPBACK,UP,LOWER_UP>                                  โ”‚
โ”‚       โ”‚    โ”‚    โ”‚                                        โ”‚
โ”‚       โ”‚    โ”‚    โ””โ”€โ”€ the carrier is present               โ”‚
โ”‚       โ”‚    โ””โ”€โ”€ the administrative up                     โ”‚
โ”‚       โ””โ”€โ”€ the loopback                                   โ”‚
โ”‚                                                          โ”‚
โ”‚  THE INTERPRETATION                                      โ”‚
โ”‚                                                          โ”‚
โ”‚  UP + LOWER_UP  โ†’ the interface is ready                 โ”‚
โ”‚  UP, no LOWER_UP โ†’ the cable is unplugged                โ”‚
โ”‚  DOWN           โ†’ the interface is disabled              โ”‚
โ”‚                                                          โ”‚
โ”‚  The two flags are the different:                        โ”‚
โ”‚    UP is the administrative (the ip link set up)         โ”‚
โ”‚    LOWER_UP is the physical (the cable)                  โ”‚
โ”‚                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: The Statistics

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ip -s link                                              โ”‚
โ”‚                                                          โ”‚
โ”‚  RX:  bytes packets errors dropped  missed   mcast       โ”‚
โ”‚       โ”‚     โ”‚       โ”‚       โ”‚        โ”‚       โ”‚           โ”‚
โ”‚       โ”‚     โ”‚       โ”‚       โ”‚        โ”‚       โ””โ”€โ”€ the multicastโ”‚
โ”‚       โ”‚     โ”‚       โ”‚       โ”‚        โ””โ”€โ”€ the ring buffer โ”‚
โ”‚       โ”‚     โ”‚       โ”‚       โ””โ”€โ”€ the kernel (buffer)      โ”‚
โ”‚       โ”‚     โ”‚       โ””โ”€โ”€ the hardware or the driver       โ”‚
โ”‚       โ”‚     โ””โ”€โ”€ the total                                โ”‚
โ”‚       โ””โ”€โ”€ the total                                      โ”‚
โ”‚                                                          โ”‚
โ”‚  TX:  bytes packets errors dropped carrier collsns       โ”‚
โ”‚                                      โ”‚       โ”‚           โ”‚
โ”‚                                      โ”‚       โ””โ”€โ”€ the collisionsโ”‚
โ”‚                                      โ””โ”€โ”€ the carrier lossesโ”‚
โ”‚                                                          โ”‚
โ”‚  The errors and the drops are the diagnosis.             โ”‚
โ”‚                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: The Scope

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  scope global                                            โ”‚
โ”‚    The globally routable.                                โ”‚
โ”‚    The normal address.                                   โ”‚
โ”‚                                                          โ”‚
โ”‚  scope link                                              โ”‚
โ”‚    The link-local.                                       โ”‚
โ”‚    The 169.254.x.x (the IPv4) or the fe80::/10 (the IPv6).โ”‚
โ”‚    The valid only on the local link.                     โ”‚
โ”‚                                                          โ”‚
โ”‚  scope host                                              โ”‚
โ”‚    The loopback.                                         โ”‚
โ”‚    The 127.0.0.1 or the ::1.                             โ”‚
โ”‚    The valid only on the device.                         โ”‚
โ”‚                                                          โ”‚
โ”‚  The scope is the address's reach.                       โ”‚
โ”‚                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ItemValue
ip linkThe link layer
ip addrThe network layer
ip -s linkThe statistics
The interfaceThe name, the state, the MTU, the MAC
The addressThe IP, the prefix, the scope
The stateThe UP, DOWN, UNKNOWN
The flagsThe UP, LOWER_UP, BROADCAST
The statisticsThe bytes, the packets, the errors, the drops
The scopeThe global, link, host
The multipleThe primary, the secondary

Key takeaways:

  • The ip link shows the link layer, and the ip addr shows the network layer โ€” the two together are the complete picture of an interface
  • The UP is the administrative state, and the LOWER_UP is the physical โ€” the UP without the LOWER_UP means the cable is unplugged, which is the common diagnosis
  • The interface names follow the predictable pattern โ€” the eth0 for the Ethernet, the wlan0 for the wireless, the lo for the loopback, the docker0 for the Docker bridge
  • The ip -s link shows the statistics โ€” the errors, the drops, the missed, the carrier, and the collisions are the diagnosis for the problems the state alone does not reveal
  • The collisions indicate the duplex mismatch โ€” the modern Ethernet is the full-duplex, and the collisions are the switch’s port’s problem
  • The inet and the inet6 lines are the IPv4 and the IPv6 โ€” the -4 and the -6 filters show the family-specific
  • The scope is the address’s reach โ€” the global is the globally routable, the link is the link-local, and the host is the loopback
  • The dynamic and the valid_lft are the DHCP’s โ€” the lease’s timers show the remaining, and the forever is the static
  • The multiple addresses are the primary and the secondary โ€” the interface can have the multiple, and the secondary flag marks the additional
  • The ip addr add and the ip addr del are the temporary โ€” the persistence is the configuration’s, and the ip command is the runtime

Remember: The ip link and the ip addr are the first tools in any network diagnosis. The link layer shows the state and the MAC, the network layer shows the addresses and the prefixes, and the statistics show the errors and the drops. The UP and the LOWER_UP are the two flags to check, the errors and the drops are the counters to watch, and the scope is the address’s reach. The two commands together are the interface’s complete picture.


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!