Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
14  
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" –  Charles Dec 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
62  
ifconfig is deprecated? I must have been living in a cave –  wim Dec 17 '12 at 14:00
11  
I find it curious that a command called "ip" has the capability to do link-level operations. –  James O'Gorman Dec 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 Lasiewski Dec 18 '12 at 2:58

4 Answers 4

up vote 85 down vote accepted

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
share|improve this answer
10  
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 –  TheLQ Dec 18 '12 at 18:20
4  
@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. –  BatchyX Dec 18 '12 at 19:32
4  
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
    
"The command /bin/ip has been around for some time now." On some distributions of Linux. Everywhere else, it's some variation on ifconfig. –  Kaz Dec 19 '12 at 22:52
3  
Your first example answers it. Why run 2 commands when 1 does it? –  ott-- Apr 30 '13 at 18:21

ifconfig is deprecated for many years now, time to switch, especially in a case like yours.

share|improve this answer
    
I also like its cisco-esque command shortening. "ip a" = "ip address show" –  Coops Dec 17 '12 at 11:15
4  
meh. There's enough scripts and other tools around that are built over ifconfig, that I don't feel the need to switch until it disappears... –  Jason Antman Dec 17 '12 at 19:55
4  
I've never heard of ip. I just tested it on a FreeBSD server and it says ip: Command not found.. Maybe ifconfig is only deprecated on Linux. –  ctype.h Dec 18 '12 at 3:25
1  
@ctype.h: Indeed, it is only deprecated on linux. ifconfig's release targetting linux dates back from 1999. ip was already the recommended choice for 2.4 kernels. –  BatchyX Dec 18 '12 at 18:15

Yes, ifconfig is deprecated in favor of iproute2 (the ip command) on Linux.

Linux distribution are slowly deprecating ifconfig. However, iproute2 is Linux specific, when some other Unixes use ifconfig, so it may help to know/remember how it works if you're ever going to use another Unix...

I suggest you to look at those 3 links :

According to the last link, ifconfig has not been maintained for +10 years:

Except for the patch mass that Debian accumulated, the net-tools package has not seen any upstream development after version 1.60, released sometime about April 15 2001.

share|improve this answer
1  
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
    
10 years!? Time to launch a "save ifconfig" project on GitHub, I guess. –  radium May 1 '13 at 14:46

ip has been the replacement for ifconfig for a while, probably at some point ifconfig will update, however I wouldn't wait for it and learn to work with ip as well. Its supported on all linux distri's

share|improve this answer
3  
ip has been the replacement for ifconfig on Linux, as a choice made by some distros. –  Kaz Dec 19 '12 at 22:51

protected by Chris S May 1 '13 at 14:37

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.