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 COMMANDCommon 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 gatewayHow it works: ip replaced ifconfig
ipfrom the iproute2 package is the modern replacement for the oldifconfig,routeandnetstat. One interface is always present: the loopbackloat127.0.0.1, the host talking to itself. Withipyou name the object first (addr,link,route), then the action. The-oflag is handy when you parse the output withgrep,awkorwc.
Used in
You need this in the lesson Networking: inspection. The theory is the chapter Networking basics.
See also
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.