$linuxjunkies
>

How to Use the ip Command

Master the ip command to manage interfaces, addresses, routes, and ARP neighbours — the modern replacement for ifconfig, route, and arp on Linux.

BeginnerUbuntuDebianFedoraArch8 min readUpdated June 7, 2026

Before you start

  • A Linux system with iproute2 installed (present by default on all modern distros)
  • Root access or sudo privileges for commands that change network state
  • Basic understanding of IP addresses and subnets (e.g. what /24 means)

The ip command from the iproute2 package has been the standard tool for Linux network configuration since the mid-2000s. ifconfig, route, and arp are deprecated — they are absent from minimal installs on modern distros and can show incomplete information on systems using network namespaces or multiple routing tables. Everything you used to do with those tools maps cleanly to ip, and ip does more.

Quick Orientation: How the Command Is Structured

Every ip invocation follows the same pattern:

ip [options] OBJECT COMMAND [arguments]

The main objects you'll work with daily are link (network interfaces), address (IP addresses), route (routing table), and neighbour (ARP/NDP cache). You can abbreviate any object or command to its shortest unambiguous prefix — ip a is the same as ip address, ip r is ip route.

Viewing Network Interfaces (Replacing ifconfig)

List all interfaces and their state

ip link show

Output lists every interface with its index, name, flags (UP, LOWER_UP, etc.), MTU, and MAC address. A DOWN interface is present in the kernel but not active.

Show a single interface

ip link show dev eth0

Bring an interface up or down

ip link set eth0 up
ip link set eth0 down

You need root or CAP_NET_ADMIN for any command that changes state. Prefix with sudo as needed.

Change the MTU

ip link set eth0 mtu 9000

Change the MAC address (useful for testing or privacy)

ip link set eth0 down
ip link set eth0 address 02:11:22:33:44:55
ip link set eth0 up

The interface must be down before you change its hardware address.

Managing IP Addresses (Replacing ifconfig for Addresses)

Show all addresses

ip address show

This is the direct replacement for ifconfig -a. It shows both IPv4 and IPv6 addresses, their prefix lengths, broadcast addresses, and scope.

Show addresses for one interface

ip address show dev eth0

Add an IPv4 address

ip address add 192.168.1.100/24 dev eth0

The prefix length (/24) is mandatory. Unlike ifconfig, you can assign multiple addresses to the same interface without aliases (eth0:0 syntax is not needed).

Add an IPv6 address

ip address add 2001:db8::1/64 dev eth0

Remove an address

ip address del 192.168.1.100/24 dev eth0

Important: Changes made with ip are not persistent across reboots. To make them permanent, use your distro's network manager: NetworkManager (most desktops and servers), systemd-networkd (servers and containers), or distro-specific config files.

Working with the Routing Table (Replacing route)

View the routing table

ip route show

Each line shows a destination network, the gateway (via), the outgoing interface (dev), and metric. The default entry is your default gateway.

Add a default gateway

ip route add default via 192.168.1.1 dev eth0

Add a static route to a specific network

ip route add 10.10.0.0/16 via 192.168.1.254 dev eth0

Delete a route

ip route del 10.10.0.0/16

Find which route will be used for a destination

ip route get 8.8.8.8

This is extremely useful for diagnosing routing problems. It shows exactly which interface and gateway the kernel would use — including policy routing decisions — for a specific destination address.

Flush all routes on an interface (use carefully)

ip route flush dev eth0

Viewing the ARP and NDP Cache (Replacing arp)

The neighbour table stores the MAC-to-IP mappings learned via ARP (IPv4) and NDP (IPv6).

Show the neighbour cache

ip neighbour show

Entries show the IP, the interface, the MAC address, and a state: REACHABLE, STALE, DELAY, FAILED, or PERMANENT. Stale entries are still usable but haven't been confirmed recently.

Add a static ARP entry

ip neighbour add 192.168.1.50 lladdr aa:bb:cc:dd:ee:ff dev eth0 nud permanent

Delete a neighbour entry

ip neighbour del 192.168.1.50 dev eth0

Flush the entire neighbour cache

ip neighbour flush all

Flushing the ARP cache forces the kernel to re-learn all MAC addresses. This is sometimes needed after a network change (switch replacement, IP move) where old ARP entries cause connectivity failures.

Useful Flags and Output Options

  • -4 or -6 — restrict output to IPv4 or IPv6 only: ip -6 address show
  • -br — brief, tabular output, easier to scan: ip -br link show
  • -c — colorized output (terminal support required): ip -c -br address show
  • -s — show statistics (byte/packet counters): ip -s link show eth0
  • -j — JSON output, useful for scripting: ip -j route show | jq .

Verifying Your Work

After any change, confirm the live state with a combination of:

ip -br address show
ip route show
ip neighbour show

Then test actual connectivity:

ping -c 4 192.168.1.1        # gateway reachability
ping -c 4 8.8.8.8            # internet reachability
ping -c 4 google.com         # DNS + internet

Troubleshooting Common Problems

A route for that network already exists. View it with ip route show, delete the old entry with ip route del, then add the new one.

Interface shows UP but no traffic

Check that LOWER_UP appears in ip link show — its absence means no physical link (cable unplugged, SFP missing, Wi-Fi not associated). Also confirm an IP address is assigned with ip address show dev eth0.

Changes lost after reboot

ip modifies the live kernel state only. Persist settings via NetworkManager (nmcli), systemd-networkd (/etc/systemd/network/*.network files), or your distro's native network config:

  • Debian/Ubuntu: /etc/netplan/ (Netplan front-end to systemd-networkd or NetworkManager)
  • Fedora/RHEL/Rocky: nmcli or /etc/NetworkManager/system-connections/
  • Arch: systemd-networkd or NetworkManager depending on your install

"Cannot find device" errors

The interface name you specified doesn't exist. List available interfaces with ip link show and check for predictable names like enp3s0 or ens18 rather than the older eth0.

tested on:Ubuntu 24.04Debian 12Fedora 40Arch rolling

Frequently asked questions

Is ifconfig completely gone from modern Linux?
It is absent from minimal and server installs on Debian 12+, Ubuntu 22.04+, Fedora, RHEL 9, and Arch by default. You can still install net-tools to get it back, but it is unmaintained and doesn't understand network namespaces or some modern interface types.
How do I make ip command changes survive a reboot?
The ip command writes directly to the kernel's live network state and nothing is saved to disk. Use NetworkManager (nmcli), Netplan on Ubuntu/Debian, or systemd-networkd unit files to persist configuration across reboots.
What is the difference between ip link and ip address?
ip link deals with Layer 2 — the interface itself, its state (up/down), MTU, and MAC address. ip address deals with Layer 3 — the IP addresses assigned to those interfaces. You often need both when setting up an interface from scratch.
Can I use ip to configure Wi-Fi?
ip can bring a Wi-Fi interface up or down and assign addresses, but it cannot handle authentication or association. For that you need iw and wpa_supplicant, or simply NetworkManager which handles the full Wi-Fi workflow including WPA2/3.
How do I see traffic statistics like ifconfig used to show?
Run ip -s link show eth0. The -s flag adds RX/TX packet and byte counters, plus error and drop counts. Add -s twice (ip -s -s link show eth0) for even more detail including additional error breakdowns.

Related guides