Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · interfaces & addressing

ip addr

what this host calls itself

ip addr prints each network interface with the addresses bound to it — the MAC on the link, the IPv4 address and prefix, and the IPv6 addresses the kernel configured for itself. It replaced ifconfig, which cannot show more than one address per interface properly.

An address belongs to an interface, not to the machine — one host is as many addresses as it has links.

Reads
Addresses per link
IPv4, IPv6 and the MAC
Short form
ip a
every object name abbreviates
Needs root
Only to change
reading is unprivileged
Replaces
ifconfig
net-tools, long unmaintained

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

user@netflow — bashiproute2
$ ip addr show eth0
12: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
2 link/ether 52:54:00:3a:9c:1e brd ff:ff:ff:ff:ff:ff
3 inet 192.168.1.42/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0
4 valid_lft 85912sec preferred_lft 85912sec
5 inet6 fe80::5054:ff:fe3a:9c1e/64 scope link
valid_lft forever preferred_lft forever
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
The flags are two different kinds of "up"

UP means an administrator enabled the interface. LOWER_UP means the link itself has carrier — a cable is in and the far end answers. UP without LOWER_UP is an unplugged port.

2
link/ether is the layer-2 address

The MAC this interface puts in every Ethernet frame it sends, followed by the broadcast address frames to everyone are sent to.

3
inet is the IPv4 address and its prefix

/24 says the first 24 bits name the network, so 192.168.1.0 to 192.168.1.255 is on-link. "dynamic" says the address came from DHCP rather than being typed in.

4
The lifetimes are the DHCP lease

valid_lft counts down the seconds until the address must be renewed or dropped. A statically configured address reads "forever".

5
fe80:: is the link-local IPv6 address

The kernel assigns one to every IPv6-capable interface without asking anyone. "scope link" means it is never routed off this segment.

Switches

A switch changes how the command behaves. These are the ones used day to day; man ip lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.

-br
Brief: one line per interface — name, state and addresses. Written "ip -br addr".
-4
Show only IPv4 addresses.
-6
Show only IPv6 addresses.
-c
Colour the output, so addresses and states stand out.
-s
Add statistics: packets, bytes and errors per interface.
-j
Print JSON, for scripts. Add -p to make it readable.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

ip -br addr

One line per interface — name, state and addresses. The form to reach for first.

ip -4 addr show dev eth0

Only the IPv4 addresses of one interface; -6 does the same for IPv6.

ip addr add 192.168.1.50/24 dev eth0

Binds a second address to the interface. Lost at reboot unless the network manager also knows it.

ip addr del 192.168.1.50/24 dev eth0

Removes exactly that address and prefix, leaving the others in place.

In cybersecurity

The address list is the first thing an attacker reads after landing on a host, because it maps every network the machine can reach. It is equally the first thing a defender should read.

Unexpected interfaces

A tun, tap or wg interface nobody remembers creating is a tunnel out of the network. Account for every one.

Dual-homed hosts

A machine with an address in two segments is a bridge between them, whatever the firewall diagram says.

Secondary addresses

An extra address on a live interface can impersonate a neighbour or quietly host a service. ifconfig would not have shown it.

IPv6 nobody planned for

Link-local and autoconfigured IPv6 addresses appear by default. If the firewall only filters IPv4, they are an open side door.

Changes do not persist

An address added by hand vanishes at reboot — convenient for an intruder, and a reason to compare live state with the configuration.

MAC as identity

The link/ether value is trivially changed. Port security and DHCP reservations that trust it are trusting a claim.

Protocols it shows

IPv4IPv6EthernetDHCP

Read alongside