Should I quit using Ifconfig?

Solution 1:

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

Solution 2:

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

Similarly, the arp, route and netstat commands are also deprecated.

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...

To learn the "new way", I suggest you to look at those 3 links :

  • iproute2: Life after ifconfig (the basics, from poumpoumk's answer),
  • Deprecated Linux networking commands and their replacements (details),
  • Why ifconfig sucks (and how to use ip when it does).

According to the last link, ifconfig has not been maintained for +15 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.


Solution 3:

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


Solution 4:

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