The ip command in Linux

The ip command (from iproute2) is the current interface to Linux networking: addresses, interfaces, routing tables, neighbors. It replaced ifconfig, route and arp, which remain installed on some systems but no longer see new features. Its grammar is object-verb: ip OBJECT COMMAND — ip addr show, ip route add.

How ip works

ip is the front-end to netlink, the socket-based protocol modern Linux uses for kernel networking configuration. Every ip subcommand composes a netlink message, sends it to the kernel, and formats the reply — the same channel NetworkManager and systemd-networkd use, which is why they never fight over state the way tools of different eras did. The deprecated ifconfig used older ioctl calls that simply cannot express newer features (multiple addresses per interface, policy routing), which is why it shows an incomplete picture on modern systems.

Everything ip touches is live kernel state: tables in RAM, gone at reboot. Persistence is deliberately someone else's job — netplan, NetworkManager, systemd-networkd — which write configs that regenerate this state at boot. Understanding the split (ip = runtime truth, config files = boot recipe) resolves the eternal "my change vanished" confusion and makes ip the right tool for diagnosis and temporary surgery, never for permanence.

Syntax

ip [OPTIONS] OBJECT COMMAND

Common options

OptionWhat it does
ip addr (ip a)Show IP addresses on every interface.
ip linkShow interfaces and their state (UP/DOWN), MACs, MTU.
ip route (ip r)Show the routing table — including the default gateway.
ip -br addrBrief, one line per interface — the readable variant.
ip neighThe ARP/neighbor table: which MACs answer for which IPs.
-cColorized output.

How to use ip: examples

$ ip -br -c addr

The overview to memorize: every interface, state and address, one line each, in color.

$ ip route

"default via 192.168.1.1 dev eth0" — your gateway and which interface traffic leaves through.

$ ip route get 8.8.8.8

Which route (and source address) would be used to reach a specific destination — invaluable on multi-homed machines.

$ sudo ip addr add 192.168.1.50/24 dev eth0

Add an address to an interface (until reboot; persistence lives in your distro's network config).

$ sudo ip link set eth0 up

Bring an interface up (or down) administratively.

Real-world use cases for ip

The five-command network diagnosis

Connectivity is broken: ip -br addr (do I have an address?), ip route (do I have a gateway?), ping the gateway, ping 8.8.8.8, dig something. Each step isolates a layer; the whole ritual takes ninety seconds and localizes almost any network fault.

A temporary second address

Migrating a service between IPs: ip addr add the new address on the interface, test everything against it, and only then make it permanent in config. Live state as a rehearsal space, persistence once proven.

Pro tips and common mistakes

Frequently asked questions about ip

What replaced ifconfig?

ip addr and ip link cover ifconfig; ip route covers route; ip neigh covers arp. Muscle-memory mapping: ifconfig → ip a.

Why does my ip change disappear after reboot?

ip edits the live kernel state only. Permanent configuration belongs to netplan, NetworkManager or systemd-networkd depending on the distribution.

How do I find my IP address?

ip -br addr shows all local addresses. Your public address (behind NAT) is different: curl ifconfig.me asks the internet how it sees you.

Related commands

ping

Check whether a host is reachable and measure round-trip latency.

ss

See listening ports, active connections and which process owns each socket.

dig

Ask DNS questions directly: A, MX, TXT records, and which server answered.

Want to build real fluency? The interactive course takes you through ip and every other essential command with guided, checked exercises.