December 6, 2026

The ip Command for People Who Still Type ifconfig: A Translation Table, Tested

An old worn reference card beside a crisp new one on a desk

On a fresh Linux install, ifconfig increasingly answers with “command not found.” It belongs to the net-tools package, which many distributions no longer install by default, and its replacement, ip from iproute2, has been the standard tool for years. The two do the same jobs with different words. Below, each common task is run with ip on Ubuntu 24.04 (iproute2 6.1.0), on a real interface and a pair of virtual ones, with the output it returned.

Video: Learn Linux TV on YouTube

Why the switch happened

net-tools on the way out

Debian keeps a wiki page tracking what it calls the intended deprecation of net-tools. Most of the page is a list of Debian packages that still call ifconfig, route, netstat or arp, with a note against nearly every one: “can be replaced by ip,” or for netstat, “can be replaced by ss.” The same page also asks that net-tools not simply be removed everywhere, because its commands are the portable ones shared with other operating systems.

In the test environment for this post, the commands were already gone: which ifconfig route netstat arp returned nothing, while iproute2 was installed.

One tool, several objects

The ip manual page describes the tool as show / manipulate routing, network devices, interfaces and tunnels. Where net-tools had a separate program for each job, ip takes an object as its first word:

Object What it covers Old tool
address IP and IPv6 addresses on a device ifconfig
link The network device itself ifconfig
route Routing table entries route
neighbour ARP and IPv6 neighbor cache arp

Every object name can be shortened. The manual’s example is address written as a, so ip a is the same as ip address show.

Network cable connected to a device

Seeing addresses

ip a

$ ip a
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:fc:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.2/24 brd 192.0.2.255 scope global eth0
       valid_lft forever preferred_lft forever

The address is written with its prefix length, 192.0.2.2/24, where ifconfig showed a separate netmask. The flags in angle brackets carry the interface state: UP means it was enabled, and LOWER_UP means the physical link underneath it is up, which is the “cable is plugged in” check.

The brief view

The manual describes -br as printing only basic information in a tabular format, and it is the version worth memorizing. Adding -c colors the interface names, states and addresses in a terminal:

$ ip -br a
lo               UNKNOWN        127.0.0.1/8
eth0             UP             192.0.2.2/24

One line per interface, name, state, addresses. -4 or -6 limits the output to one address family. On the test machine ip -6 -br a printed nothing at all, because no IPv6 address was configured there, not even on the loopback interface. -j prints JSON for scripts:

$ ip -j -br addr show eth0
[{"ifname":"eth0","operstate":"UP","addr_info":[{"local":"192.0.2.2","prefixlen":24}]}]

Changing addresses and links

Adding and removing an address

For changes, two virtual interfaces joined like a cable, v0 and v1, stood in for real network cards:

$ ip addr add 10.99.0.1/24 dev v0
$ ip addr add 10.99.0.2/24 dev v1
$ ip -br addr show dev v0
v0@v1            UP             10.99.0.1/24
$ ping -c 2 10.99.0.2
2 packets transmitted, 2 received, 0% packet loss

Adding the address also added a route for its subnet automatically, 10.99.0.0/24 dev v0 proto kernel. ip addr del 10.99.0.1/24 dev v0 removed both.

More than one address per interface

ip addr add can be repeated on the same interface, and each address simply appears in the list. Adding a second address to eth0 gave:

$ ip -br a show eth0
eth0             UP             192.0.2.2/24 10.99.0.1/24

With ifconfig, a second address had to be added as an alias interface such as eth0:1. ip will still accept a label eth0:1 for compatibility, but the label is not needed.

Up and down

$ ip link set v0 down
$ ip -br link show v0
v0@v1            DOWN           0e:f3:b1:2c:d5:54 <BROADCAST,MULTICAST>

While v0 was down, its subnet route disappeared from the table, and the route on the other end of the virtual cable was marked linkdown. ip link set v0 up brought it back. These changes take effect immediately and do not survive a reboot. Permanent configuration lives in the distribution’s network manager, netplan or NetworkManager on Ubuntu, not in ip commands.

Paper map

Routes

The table

$ ip route
default via 192.0.2.1 dev eth0
192.0.2.0/24 dev eth0 proto kernel scope link src 192.0.2.2

Two lines: everything not otherwise known goes to 192.0.2.1, and the local /24 is reached directly. route -n used to show the same thing as a table with a separate genmask column.

Which route will this address use?

The command net-tools never had is ip route get, which asks the kernel to make the routing decision for one address and report it:

$ ip route get 1.1.1.1
1.1.1.1 via 192.0.2.1 dev eth0 src 192.0.2.2 uid 0

It shows the gateway, the outgoing interface and the source address the machine will use. With several routes, VPNs or policy rules in play, reading the table by eye goes wrong easily; ip route get gives the answer the kernel will act on.

Adding a static route

$ ip route add 203.0.113.0/24 via 10.99.0.2 dev v0
$ ip route get 203.0.113.9
203.0.113.9 via 10.99.0.2 dev v0 src 10.99.0.1 uid 0
$ ip route del 203.0.113.0/24

Several routing tables

The plain ip route output is only one table. The rule object, which the manual describes as the routing policy database, shows how many there are and in what order they are consulted:

$ ip rule show
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default

Every packet is checked against the local table first, then main, which is the one ip route prints, then default. ip route show table local lists what lives in the first one: entries such as local 192.0.2.2 dev eth0, which tell the kernel that traffic to the machine’s own addresses stays on the machine. VPN clients and multi-homed servers add their own rules and tables here, which is why a route that looks correct in ip route can still be overridden. route -n showed only the main table and had no view of the rules at all.

Neighbors and counters

The ARP cache

ip neigh lists the link-layer addresses the machine has learned, which arp -n used to show:

$ ip neigh
192.0.2.1 dev eth0 lladdr 02:fc:00:00:00:05 REACHABLE

The gateway’s MAC address, with its state. REACHABLE means it was confirmed recently. FAILED next to the gateway means the machine cannot reach the router at the link layer at all, which points at the cable, the switch or the VLAN rather than at IP settings.

Packet and error counters

-s adds statistics, and the manual notes that repeating it adds more:

$ ip -s link show eth0
    RX:  bytes packets errors dropped  missed   mcast
        369227     402      0       0       0       0
    TX:  bytes packets errors dropped carrier collsns
        335192     381      0       0       0       0

Rising errors or dropped counts on a physical interface are worth a look at the cable or the duplex settings. carrier errors on transmit mean the link itself kept dropping.

White desk with a laptop and a lamp

The translation table

Task net-tools iproute2
Show addresses ifconfig ip a, ip -br a
Show one interface ifconfig eth0 ip a show eth0
Add an address ifconfig eth0 10.0.0.5 netmask 255.255.255.0 ip addr add 10.0.0.5/24 dev eth0
Second address ifconfig eth0:1 10.0.0.6 ip addr add 10.0.0.6/24 dev eth0
Interface up or down ifconfig eth0 up ip link set eth0 up
Show routes route -n ip route
Default gateway route add default gw 10.0.0.1 ip route add default via 10.0.0.1
Route for one address (none) ip route get 1.1.1.1
Policy rules (none) ip rule show
ARP cache arp -n ip neigh
Interface counters ifconfig (bottom lines) ip -s link
Listening ports netstat -tlnp ss -tlnp

ss, the last line, comes from the same iproute2 package; dpkg -S /bin/ss on the test machine reported iproute2: /bin/ss. ss -tln printed the machine’s listening TCP sockets in the test, in the same column layout netstat users know.

If ifconfig is still wanted

The old tools are still packaged; on Debian and Ubuntu the package is net-tools. Nothing breaks by installing it. The reason to learn ip anyway is that it shows things ifconfig cannot, multiple addresses without aliases, routing decisions, policy rules, and that scripts and documentation increasingly assume it.

Sources

  • ip(8), Linux manual page, man7.org: https://man7.org/linux/man-pages/man8/ip.8.html
  • Debian Wiki, “NetToolsDeprecation”: https://wiki.debian.org/NetToolsDeprecation

920 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *