$linuxjunkies
>

ip(8)

Show and manipulate routing, network devices, interfaces, and tunnels.

UbuntuDebianFedoraArch

Synopsis

ip [ OPTIONS ] OBJECT { COMMAND | help }

Description

The ip command is the primary tool for configuring network interfaces, routing tables, and tunnels on modern Linux systems. It replaces older deprecated tools like ifconfig, route, and arp.

OBJECT specifies what to manipulate: address (addresses), link (devices), route (routing tables), rule (routing policies), neigh (ARP cache), tunnel, maddr (multicast), and others.

Common options

FlagWhat it does
-4Use IPv4 addresses only
-6Use IPv6 addresses only
-cColorize output
-sPrint statistics and counters
-hPrint human-readable numbers with units (K, M, G, T)
-jOutput in JSON format
-pPrint process that created the netlink request
-oOutput each record on a single line

Examples

Display all IP addresses assigned to all interfaces

ip address show

Add IP address 192.168.1.100 with /24 netmask to eth0

ip addr add 192.168.1.100/24 dev eth0

List all network interfaces and their status (UP, DOWN, etc)

ip link show

Bring up (enable) the eth0 interface

ip link set eth0 up

Display the routing table

ip route show

Add a route to 10.0.0.0/8 network via gateway 192.168.1.1

ip route add 10.0.0.0/8 via 192.168.1.1

Display ARP cache (neighbor table)

ip neigh show

Show eth0 interface with statistics including packets sent/received

ip -s link show eth0

Related commands