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.

The sooner you switch, the better. It took me months to replace the muscle-memory of ifconfig. It does make operations on Windows even more fun though. "ip add-no, wait, that's not it, ifcon-NO, argh ipconfig"
–
CharlesDec 17 '12 at 10:09

4

Maybe an alias will help: alias ipconfig='echo ipconfig is deprecated, use ip instead'. Of course you set up more senseful aliases.
–
ott--Dec 17 '12 at 10:13

72

ifconfig is deprecated? I must have been living in a cave
–
wimDec 17 '12 at 14:00

14

I find it curious that a command called "ip" has the capability to do link-level operations.
–
James O'GormanDec 17 '12 at 20:34

8

It's only deprecated on certain operating systems. If you use stuff outside of Linux, I believe that ifconfig is still in use. I see no such warning on FreeBSD, for example.
–
Stefan LasiewskiDec 18 '12 at 2:58

4 Answers
4

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.

Interesting how in every use case you mentioned the ip command is longer and more complex. Probably going to be a primary reason people still use ifconfig
–
TheLQDec 18 '12 at 18:20

6

@TheLQ: ip provides much, much more features. Of course it is more complex. Anyway, many commands can be shortened. e.g. ip addr show can be shortened to ip a, ip link show to ip l, ip link set eth0 up to ip l set eth0 up and so on. This brings ip on par with ifconfig.
–
BatchyXDec 18 '12 at 19:32

7

Just remember, the entire world is not a Linux machine. Solaris, AIX, HP-UX, all of the BSDs, and SCO (not that anyone cares about them) all use ifconfig. If you want to be a unix admin (not just a Linux admin) you should make sure you're at least familiar with ifconfig and its basic syntax...
–
voretaq7♦Dec 19 '12 at 18:17

ifconfig was developed by BSD back in the day. Linux essentially used BSD's IP stack (as did Windows and others of the time, why ipconfig is still similar to ifconfig). In the 2.4 Kernel Linux starting diverging heavily from BSD's stack, that was the beginning of 2001. It's not happenstance that ifconfig in Linux hasn't been well maintained since then.
–
Chris S♦Apr 30 '13 at 18:02

1

10 years!? Time to launch a "save ifconfig" project on GitHub, I guess.
–
radiumMay 1 '13 at 14:46