The ip command replaced ifconfig and route a decade ago, and it is the tool every modern distro actually ships. Addresses, links, routes, neighbours — one command, consistent grammar, and a shorthand form that makes daily use fast.
The grammar #
Every ip command is ip OBJECT COMMAND: which table to look at, then what to do — addr show, link set, route add. The words abbreviate freely as long as they stay unambiguous (a = addr, r = route, l = link).
$ ip addr show # addresses on every interface
$ ip -br addr # the same, one line per interface
$ ip route # the routing table
$ ip link # interface states
-br (brief) is the flag nobody forgets after seeing it once — one line per interface with state and address:
$ ip -br addr
lo UNKNOWN 127.0.0.1/8
wlan0 UP 192.168.1.42/24
docker0 DOWN 172.17.0.1/16
Reading the output #
$ ip addr show wlan0
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 ...
inet 192.168.1.42/24 brd 192.168.1.255 scope global wlan0
The /24 is the prefix — network size in CIDR notation; scope global means routable (contrast scope host for loopback). Flags <UP,LOWER_UP> answer "is the link actually alive" in one glance, which troubleshooting always wants first.
The changes you will make #
| Task | Command |
|---|---|
| Bring an interface up/down | ip link set eth0 up |
| Add an address | ip addr add 10.0.0.5/24 dev eth0 |
| Remove an address | ip addr del 10.0.0.5/24 dev eth0 |
| Add a route | ip route add 10.10.0.0/16 via 10.0.0.1 |
| Default route | ip route add default via 192.168.1.1 |
| Routing cache flush | ip route flush cache |
Manual changes vanish at reboot or reconnect — deliberate persistence belongs in NetworkManager, systemd-networkd, or your distro's netplan, which write these same commands for you.
The diagnostics worth knowing #
$ ip neigh # the ARP table: IP -> MAC, reachable or stale
The neighbour table tells you what the machine believes is nearby — STALE entries explain one-way connectivity mysteries, and FAILED entries mean ARP itself is not answering, which is a link-level problem before it is an IP one.
ip -br a on arrival, ip r for "why does this go that way", ip neigh for "is the peer even there" — three reads cover nearly every first-minute network diagnosis on a Linux box.
From here: ping tests reachability, ss lists the sockets, and dig checks the name layer. The network series continues.
