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
| Option | What it does |
|---|---|
ip addr (ip a) | Show IP addresses on every interface. |
ip link | Show interfaces and their state (UP/DOWN), MACs, MTU. |
ip route (ip r) | Show the routing table — including the default gateway. |
ip -br addr | Brief, one line per interface — the readable variant. |
ip neigh | The ARP/neighbor table: which MACs answer for which IPs. |
-c | Colorized 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
- ip -br -c addr (brief, color) is the human-friendly view — alias it.
- ip route get DEST answers "which interface and source IP would I use to reach this?" — gold on VPNs and multi-homed boxes.
- Changes made with ip evaporate at reboot by design; treat that as a feature for safe experiments.
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
Check whether a host is reachable and measure round-trip latency.
ssSee listening ports, active connections and which process owns each socket.
digAsk DNS questions directly: A, MX, TXT records, and which server answered.