By default in CentOS 7 minimal the ifconfig command is not available, and for good reason, it’s considered deprecated and has been replaced by the ip command.
Regardless, if you really can’t get by without ifconfig, here’s how you can install it.
Ifconfig is part of the ‘net-tools’ package which is available in the CentOS Base repository, we can install it with the yum command as shown below.
[[email protected] ~]# yum install net-tools -y
But how can we find this out if we did not already know where to find it? We can find this information with ‘yum provides’ as shown below. In the below example we can clearly see that the net-tools package does indeed provide us with ifconfig.
[[email protected] ~]# yum provides */ifconfig net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools Repo : base Matched from: Filename : /sbin/ifconfig
That’s all there is to it, you should now be able to use the ifconfig command.
Keep in mind that the ip command is going to be the way forward, so it’s definitely worth learning and getting used to.
So in CentOS 7 where is ifconfig? Not installed typically.
We have shown you how to install the net-tools package which provides the ifconfig command, which is not otherwise available in a minimal installation of CentOS 7 Linux out of the box.