ip(8)
Show and manipulate routing, network devices, interfaces, and tunnels.
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
| Flag | What it does |
|---|---|
-4 | Use IPv4 addresses only |
-6 | Use IPv6 addresses only |
-c | Colorize output |
-s | Print statistics and counters |
-h | Print human-readable numbers with units (K, M, G, T) |
-j | Output in JSON format |
-p | Print process that created the netlink request |
-o | Output each record on a single line |
Examples
Display all IP addresses assigned to all interfaces
ip address showAdd IP address 192.168.1.100 with /24 netmask to eth0
ip addr add 192.168.1.100/24 dev eth0List all network interfaces and their status (UP, DOWN, etc)
ip link showBring up (enable) the eth0 interface
ip link set eth0 upDisplay the routing table
ip route showAdd 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.1Display ARP cache (neighbor table)
ip neigh showShow eth0 interface with statistics including packets sent/received
ip -s link show eth0