ifconfig vs iproute2 – Should You Quit Using Ifconfig?

ifconfigiproute2linuxnetworking

With the servers that mount Infiniband cards, when I use the ifconfig command, I get this warning:

Ifconfig uses the ioctl access method to get the full address 
information, which limits hardware addresses to 8 bytes.
Because Infiniband address has 20 bytes, only the first 8 bytes 
are displayed correctly.
Ifconfig is obsolete! For replacement check ip.

Should I quit using ifconfig? Is it deprecated in favor of the ip command? Or will it be updated in the near future?

Note: This question and answers are in regards to GNU/Linux's "major" distributions. It should not be assumed that the information applies to all distributions, and especially not other OSes.

Best Answer

Quoting Thomas Pircher's website (cc-by-sa):

ifconfig vs ip

The command /bin/ip has been around for some time now. But people continue using the older command /sbin/ifconfig. Let's be clear: ifconfig will not quickly go away, but its newer version, ip, is more powerful and will eventually replace it.

The man page of ip may look intimidating at first, but once you get familiar with the command syntax, it is an easy read. This page will not introduce the new features of ip. It rather features a side-by-side comparison if ifconfig and ip to get a quick overview of the command syntax.

Show network devices and configuration

ifconfig

ip addr show
ip link show

Enable a network interface

ifconfig eth0 up
ip link set eth0 up

A network interface is disabled in a similar way:

ifconfig eth0 down
ip link set eth0 down