Quick take: The ip command is the modern tool for Linux networking, replacing ifconfig and route. Use ip a to show addresses, ip r to show routes, and ip link set to bring interfaces up or down.
Introduction
The ip command is the modern, unified tool for inspecting and configuring Linux networking. It replaces the older ifconfig, route, and arp commands with a single, consistent interface organised into objects: address, link, route, and more.
This guide covers the everyday tasks — viewing IP addresses and interfaces, checking the routing table, and bringing links up or down.
Syntax
The basic syntax of the ip command is:
ip [OPTIONS] OBJECT { COMMAND }Common Options and Parameters
The most useful options and parameters for the ip command:
| Option | Description |
|---|---|
| a, addr | Show or manage IP addresses (ip a). |
| l, link | Show or manage network interfaces (ip link). |
| r, route | Show or manage the routing table (ip r). |
| neigh | Show the ARP/neighbour table. |
| -br | Brief, columnar output (ip -br a). |
| -s | Show statistics (e.g. ip -s link). |
| link set DEV up/down | Bring an interface up or down. |
| addr add IP dev DEV | Add an IP address to an interface. |
| route add ... via ... | Add a route. |
Practical Examples
Real ip commands you can run today:
# Show all IP addresses
ip a
# Brief, readable address summary
ip -br a
# Show the routing table
ip r
# Show network interfaces
ip link
# Bring an interface up
sudo ip link set eth0 up
# Add an IP address to an interface
sudo ip addr add 192.168.1.50/24 dev eth0
# Show the default gateway
ip route | grep defaultMaking ip Changes Permanent
Anything you configure with the ip command lives only in memory and disappears at the next reboot. For permanent network settings you must edit your distribution's configuration layer, which reapplies them at boot.
On modern Ubuntu, that layer is Netplan: you describe interfaces in a YAML file under /etc/netplan/ and run sudo netplan apply. On systems using NetworkManager (common on desktops and RHEL-family servers), use nmcli or nmtui. The ip command remains the right tool for inspecting state and for temporary changes while testing — just remember to commit anything you want to keep to Netplan or NetworkManager.
Tips and Best Practices
- Use
ip -br afor a clean, column-aligned view of interfaces and their addresses. - Changes made with
ipare not persistent — they reset on reboot. Use Netplan (Ubuntu) or NetworkManager for permanent configuration. ip areplacesifconfig, andip rreplacesroute -non modern distributions.
Final Thoughts
The ip command is the one networking tool to learn on modern Linux, unifying address, link, and route management that used to need three separate commands. Memorise ip a, ip r, and ip link set, and remember that its changes are temporary — make them permanent through your distribution's network configuration. Pair it with ss to see active connections.
FAQ: ip Command in Linux
How do I show my IP address in Linux?+
Run ip a (or ip addr) to list every interface and its addresses. Use ip -br a for a brief, readable summary.
What replaced ifconfig in Linux?+
The ip command from the iproute2 package replaced ifconfig, route, and arp. ip a shows addresses and ip r shows routes on modern distributions.
How do I view the routing table?+
Use ip r (or ip route). To see just the default gateway, run ip route | grep default.
How do I bring a network interface up or down?+
Use ip link set: sudo ip link set eth0 up enables it and sudo ip link set eth0 down disables it.
Why do my ip command changes disappear after reboot?+
Changes made directly with ip are not persistent. To make them permanent, configure the interface through Netplan on Ubuntu or NetworkManager, which reapply the settings at boot.
Need help with Linux servers or infrastructure?
Work directly with Muhammad Irfan Aslam for Linux, Ubuntu, Docker, DevOps, cloud, CI/CD, or infrastructure support.
Hire Me for Support