Interfaces and addresses
Modern Linux uses the ip command from iproute2 for everything network-related. ifconfig, route and arp come from the long-deprecated net-tools package and are often not even installed.
ip linkshows interfaces: name, state and MAC address. It's layer 2.ip addrshows addresses: IPv4/IPv6 addresses and prefix lengths. It's layer 3.- Add
-br(brief) for a one-line-per-interface summary, and-cfor colour.
What to look for:
- State
UPwithLOWER_UPin the flags means the interface is enabled and has a carrier (cable/link).UPwithoutLOWER_UPmeans it's enabled but nothing is plugged in.DOWNmeans an admin turned it off (ip link set eth0 up). - The prefix length matters as much as the address.
192.0.2.10/24and192.0.2.10/32behave completely differently: the prefix decides which other addresses are "on the same LAN". lois the loopback interface, always present.
Changes made with ip are immediate and not persistent: they vanish on reboot. Permanent configuration lives in your distribution's network manager (netplan on Ubuntu, NetworkManager on Fedora/RHEL, systemd-networkd, or /etc/network/interfaces on Debian); see the last section.
root@client:~# ip -br link
lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eth0@if123 UP 1a:dc:74:6a:45:dc <BROADCAST,MULTICAST,UP,LOWER_UP>
root@client:~# ip -br addr
lo UNKNOWN 127.0.0.1/8
eth0@if123 UP 192.0.2.10/24
root@client:~# ip addr show dev eth0
2: eth0@if123: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 1a:dc:74:6a:45:dc brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.0.2.10/24 scope global eth0
valid_lft forever preferred_lft forever- Lines 1–3: Layer 2: interface names, state and MAC addresses.
@if123means this is one end of a virtual ethernet (veth) pair whose peer is interface 123 in another namespace, as in containers. - Lines 4–6: Layer 3: one line per interface with its addresses. The fastest health check there is.
- Line 8: Flags:
UP(enabled) andLOWER_UP(carrier present). The MTU is 1500 bytes, standard Ethernet. - Line 9: The MAC address the router will learn via ARP.
- Line 10: The address and the prefix: /24 makes 192.0.2.0–255 "on-link".
scope globalmeans it's usable for traffic leaving the host. - Line 11: Lifetimes are
foreverfor static addresses. DHCP-assigned addresses count down to the lease expiry.
Check your understanding
ip -br link shows eth0 UP … <NO-CARRIER,BROADCAST,MULTICAST,UP>. What's wrong?
- The interface is administratively down
- There's no physical link: cable, switch port or Wi-Fi association
- It has no IP address
- The MTU is wrong