Why did the ip command replace ifconfig and route, and what are the ip equivalents of the old commands?
Show the answer
Say this first
ifconfig, route, arp and netstat come from net-tools, which talks to the kernel through old ioctl
calls and /proc files and has barely changed in years. iproute2 (ip, ss, bridge, tc) uses netlink,
the kernel's native networking interface, so it sees everything the kernel can do: several addresses per
interface, multiple routing tables and policy rules, namespaces, VRFs and tunnels. Many minimal distros no
longer install net-tools at all.
Go deeper
The mapping I use
| Old (net-tools) | New (iproute2) |
|---|---|
ifconfig | ip addr and ip link |
ifconfig eth0 up | ip link set eth0 up |
route -n | ip route |
arp -n | ip neigh |
netstat -tulpn | ss -tulpn |
netstat -i | ip -s link |
brctl show | bridge link or ip link show master br0 |
vconfig add eth0 10 | ip link add link eth0 name eth0.10 type vlan id 10 |
What ifconfig gets wrong
- It shows only the primary IPv4 address of an interface. A second address added with
ip addr addis invisible toifconfigunless it was given a label likeeth0:1. People have chased "missing" addresses for hours because of this. route -nshows only the main table. If policy routing is in use, it hides the tables that matter.- It knows nothing about namespaces, VRFs or most modern tunnel types.
Habits worth showing
ip -br addr # one line per interface: name, state, addresses
ip -br link # one line per interface: name, state, MAC, flags
ip -c route # colour output
ip -s link show ens192 # packet, error and drop countersThey will ask next
Do changes made with ip survive a reboot?
No.
ipchanges the running kernel state only. To persist, put the config where the distro's network manager reads it: netplan YAML on Ubuntu, NetworkManager connections (nmcli) on RHEL family,.networkfiles for systemd-networkd, or/etc/network/interfaceson classic Debian.Is ifconfig removed from Linux?
No, it is a userspace package (net-tools) that is deprecated and often not installed by default. You can install it, but scripts and troubleshooting should use iproute2.
Traps
- Saying ifconfig shows all addresses. It hides secondary addresses that have no label.
- Forgetting that ip changes are runtime only and vanish on reboot or on a network service restart.