Linux ip Command Reference

ip addr, ip route, ip link, ip rule subcommands with options and examples.

Reference for the Linux iproute2 ip command — address, route, link, neighbour and rule objects — with their common subcommands, options and equivalent legacy net-tools commands. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What replaced ifconfig and route?

The iproute2 ip command replaced the deprecated net-tools ifconfig, route, arp and netstat. ip addr shows interfaces, ip route shows the routing table, and ip neigh shows the ARP/neighbour cache, all with consistent syntax.

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 eth0ip addr show dev eth0
ifconfig eth0 upip link set dev eth0 up
route -nip route show
arp -nip neigh show
netstat -rip 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 r and ip l expand to ip addr, ip route and ip link, which is handy interactively.
  • Add -j to get JSON output on any ip subcommand, then pipe to jq for scripting.
  • ip route get 1.1.1.1 shows exactly which route and source address the kernel would use — invaluable for debugging routing or VPN split-tunnel issues.
  • Changes made with ip are 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.