Look up Linux ip (iproute2) commands quickly
The ip command from iproute2 is the modern way to inspect and configure Linux
networking, replacing ifconfig, route and arp. This reference groups its
common subcommands under the address, route, link, neighbour and rule objects,
showing options and the legacy command each replaces. It runs entirely in your
browser.
Object → command structure
The general form is ip [OPTIONS] OBJECT { COMMAND }. The object is addr,
route, link, neigh or rule, and the command is usually show, add,
del or set. Read operations work as any user; modifying state needs root:
ip addr show dev eth0
sudo ip addr add 10.0.0.5/24 dev eth0
sudo ip route add default via 10.0.0.1 dev eth0
sudo ip link set dev eth0 mtu 1400 up
Legacy equivalents
| Old (net-tools) | Modern iproute2 equivalent |
|---|---|
ifconfig eth0 | ip addr show dev eth0 |
ifconfig eth0 up | ip link set dev eth0 up |
route -n | ip route show |
arp -n | ip neigh show |
netstat -r | ip route show |
The net-tools package (ifconfig, route, arp) is no longer installed by default on many modern distributions. The ip command is the consistent replacement across all of them.
Diagnostics: route tracing and interface state
To see exactly which route and source address the kernel would choose to reach a host, use ip route get:
ip route get 8.8.8.8
# 8.8.8.8 via 192.168.1.1 dev eth0 src 192.168.1.50
To get a concise summary of all interfaces and their addresses:
ip -br -c addr
# lo UNKNOWN 127.0.0.1/8
# eth0 UP 192.168.1.50/24
Tips
- Abbreviations work:
ip a,ip randip lexpand toip addr,ip routeandip link, which is handy interactively. - Add
-jto get JSON output on anyipsubcommand, then pipe tojqfor scripting. ip route get 1.1.1.1shows exactly which route and source address the kernel would use — invaluable for debugging routing or VPN split-tunnel issues.- Changes made with
ipare runtime-only; persist them in netplan, NetworkManager or systemd-networkd configuration files so they survive a reboot.
Common troubleshooting scenarios
Cannot reach a host: ip route get <target> to see which interface and gateway the kernel selects. ip addr show to confirm the expected interface has an address assigned.
Interface is down after reboot: The ip link set up command is not persistent. Write the configuration into your distro’s network manager so it is applied on boot.
VPN routing conflict: ip route show table all lists every routing table including policy routes. VPN clients add routes that can interfere with regular traffic; this command reveals them all in one view.