Linuxlab

ip command in Linux: addresses and interfaces (ip addr)

Updated July 3, 2026

The ip command shows and configures networking: interfaces, addresses and routes.

Syntax

ip OBJECT COMMAND

Common cases

ip addr            # interfaces and their addresses
ip -o addr         # one address per line
ip link            # interfaces and their state (up/down)
ip route           # the routing table and default gateway

How it works: ip replaced ifconfig

ip from the iproute2 package is the modern replacement for the old ifconfig, route and netstat. One interface is always present: the loopback lo at 127.0.0.1, the host talking to itself. With ip you name the object first (addr, link, route), then the action. The -o flag is handy when you parse the output with grep, awk or wc.

Used in

You need this in the lesson Networking: inspection. The theory is the chapter Networking basics.

See also

Sockets: ss.

Try it

Open the sandbox: a real throwaway Linux terminal in your browser. Run the commands above by hand - the container is deleted when you leave.