ifconfig Command not found on CentOS 7 / RHEL 7 – Quick Fix

ifconfig is a command-line utility to configure a network interface and get an IP address of Linux machines. Are you wondering? ifconfig command not found after the installation CentOS 7 / RHEL 7.
READ: CentOS 7 installation – Step by Step with screenshot – Part 1
READ: CentOS 7 installation – Step by Step with screenshot – Part 2
-bash: ifconfig: command not found
This small guide will help you to install the necessary packages for getting ifconfig command.
Let us see which package provides us ifconfig command using the YUM command.
yum whatprovides ifconfig
Output:
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.chi.host-engine.com * epel: mirror.steadfast.net * extras: repo.us.bigstepcloud.com * updates: centos.chi.host-engine.com net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools Repo : base Matched from: Filename : /sbin/ifconfig
From the above command, you can see that the net-tools package provides you ifconfig command. Now, install the net-tools package using the yum command.
yum -y install net-tools
Output:
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.chi.host-engine.com * epel: mirror.steadfast.net * extras: repo.us.bigstepcloud.com * updates: centos.chi.host-engine.com Resolving Dependencies --> Running transaction check ---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================================================================================== Installing: net-tools x86_64 2.0-0.17.20131004git.el7 base 304 k Transaction Summary ==================================================================================================================================================================================================== Install 1 Package Total download size: 304 k Installed size: 917 k Downloading packages: net-tools-2.0-0.17.20131004git.el7.x86_64.rpm | 304 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1 Verifying : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1 Installed: net-tools.x86_64 0:2.0-0.17.20131004git.el7 Complete!
Once the installation is complete, then run ifconfig to see whether it is available or not.
ifconfig
Output:

That’s All. You now have the ifconfig command available on your CentOS 7 / RHEL 7 machine.