Why ip Replaced ifconfig and route
For decades, Linux network configuration relied on three separate tools: ifconfig for interfaces, route for routing, and arp for the ARP cache. These tools all came from the net-tools package, which stopped receiving active development. The iproute2 package introduced the ip command as a unified replacement that supports modern Linux networking features including network namespaces, policy-based routing, and more detailed interface statistics. On most modern Linux distributions, ip is installed by default and ifconfig may not be.
Command Structure
The ip command follows a consistent structure: ip [object] [command]. The object specifies what you are working with — addresses, links, routes, or neighbors. The command specifies the action — show, add, delete, or set. This pattern makes the tool predictable once you learn the object names:
ip addr # Work with IP addresses
ip link # Work with network interfaces (link layer)
ip route # Work with routes
ip neigh # Work with the ARP/neighbor cache
ip addr — Managing IP Addresses
To display all interfaces and their IP addresses:
ip addr show
For a compact one-line-per-interface summary:
ip -brief addr
Output of ip -brief addr:
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 192.168.1.50/24 fe80::a00:27ff:fe8d:c04d/64
wlan0 DOWN
To filter to a specific interface:
ip addr show eth0
To add a secondary IP address to an interface:
ip addr add 192.168.1.200/24 dev eth0
To remove it:
ip addr del 192.168.1.200/24 dev eth0
ip link — Managing Interfaces
The ip link subcommand operates at the link layer — it shows MAC addresses, MTU, and interface state, and lets you bring interfaces up or down:
ip link show # List all interfaces
ip link set eth0 up # Bring an interface up
ip link set eth0 down # Bring an interface down
ip link set eth0 mtu 9000 # Set jumbo frames MTU
MTU changes are useful when diagnosing packet fragmentation issues, particularly in VPN or tunnel environments where the effective MTU is smaller than standard Ethernet's 1500 bytes.
ip route — Managing Routes
Display the kernel routing table:
ip route show
A typical output:
default via 192.168.1.1 dev eth0 proto dhcp src 192.168.1.50 metric 100
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.50
The first line is the default route — all traffic not matching a more specific route goes to 192.168.1.1 (your gateway) via eth0. The second line is the directly connected subnet, added automatically when the interface came up.
To find which interface and gateway would be used to reach a specific destination:
ip route get 8.8.8.8
To add a static route:
ip route add 10.10.0.0/16 via 192.168.1.254 dev eth0
To delete it:
ip route del 10.10.0.0/16
ip neigh — The ARP Cache
The ip neigh subcommand is the modern equivalent of the arp command. It shows the mapping between IP addresses and MAC addresses on your local network:
ip neigh show
Output:
192.168.1.1 dev eth0 lladdr a4:b1:c2:d3:e4:f5 REACHABLE
192.168.1.20 dev eth0 lladdr 00:11:22:33:44:55 STALE
REACHABLE means the entry is fresh and confirmed. STALE means it has not been used recently and will be re-verified on next use. To flush the entire neighbor cache:
ip neigh flush all
ip vs ifconfig and route
| Task | ip command | Old equivalent |
|---|---|---|
| Show all interfaces + IPs | ip addr show |
ifconfig -a |
| Show compact interface list | ip -brief addr |
no equivalent |
| Bring interface up | ip link set eth0 up |
ifconfig eth0 up |
| Show routing table | ip route show |
route -n |
| Add static route | ip route add ... |
route add ... |
| Show ARP cache | ip neigh show |
arp -a |
| JSON output | ip -json addr |
not supported |
Persistence: Changes Are Not Saved Across Reboots
Every change made with the ip command takes effect immediately in the running kernel but does not survive a reboot. To make changes permanent, configure them through your distribution's network management layer. On Debian and Ubuntu, edit /etc/network/interfaces or use Netplan. On RHEL-based systems, edit the interface configuration files in /etc/sysconfig/network-scripts/. On systems using NetworkManager, use nmcli or the graphical network settings panel.
Frequently Asked Questions
What is the difference between ip addr and ifconfig?
ip addr is the modern replacement for ifconfig on Linux. Both display IP address and interface information, but ip addr is part of the actively maintained iproute2 package, supports newer Linux networking features like network namespaces and policy routing, and has a more consistent command structure. ifconfig is from the deprecated net-tools package.
How do I show all network interfaces with the ip command?
Run ip addr show to list all interfaces with their IP addresses, or ip link show to list all interfaces with their link-layer state and MAC addresses. Add an interface name to filter: ip addr show eth0. Use ip -brief addr for a compact one-line-per-interface summary.
How do I add or remove an IP address with the ip command?
To add: ip addr add 192.168.1.100/24 dev eth0. To remove: ip addr del 192.168.1.100/24 dev eth0. Note that these changes are not persistent — they are lost on reboot. To make them permanent, configure the address in your distribution's network configuration files or via NetworkManager.
How do I view the routing table with the ip command?
Run ip route show (or just ip route) to display the kernel routing table. Each line shows a destination network, the gateway used to reach it, and the interface to send traffic through. The default route is shown as "default via x.x.x.x dev ethX".
How do I find which interface will be used to reach a specific IP?
Use ip route get followed by the destination IP: ip route get 8.8.8.8. The kernel evaluates its routing table and tells you exactly which interface and gateway would be used to send a packet to that address. This is useful for diagnosing routing issues on machines with multiple interfaces.
Are ip command changes persistent across reboots?
No. Changes made with the ip command — adding addresses, modifying routes, bringing interfaces up or down — apply immediately to the running kernel but are lost when the system reboots. To make changes permanent, configure them in your distribution's network configuration files (/etc/network/interfaces on Debian/Ubuntu, or via NetworkManager on most desktop distributions).