commands

ip — Inspect and manage network state

iproute2 interface for addresses, links, neighbors and routing. show/get inspect; add/delete/set may change live state. -4 selects IPv4; -o uses one-line output. Use a fresh private workspace; live operations are VM-only.

Formal Syntax & Structure

linux syntaxlinux
ip [OPTIONS] OBJECT COMMAND

Parameters & Attributes

NameTypeDescription
OBJECToperandaddress, link, route or neigh
COMMANDoperandOperation
-4optionIPv4
-ooptionOne-line output

Return Value

exit status and output

iproute2 interface for addresses, links, neighbors and routing. show/get inspect; add/delete/set may change live state. -4 selects IPv4; -o uses one-line output.

Working Example

Example Snippetlinux
ip -4 -o addr show dev lo | awk '{print $4}'
Linux Reference