LinTut

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

ifconfig is a command-line utility to view network interfaces attached to Linux machines and network information such as IP address(es), netmask, etc.. assigned to network interfaces.
Also, it displays the count of sent and received network packets along with counts of error and dropped packets.
Do you get ‘IfconfigCommand Not Found in your RHEL 8 / CentOS 8 minimal server installation?. The minimal installation of RHEL 8 / CentOS 8 doesn’t come with the ifconfig command.

-bash: ifconfig: command not found

This guide will help you to install the necessary packages for getting ifconfig command.

Install ifconfig Package

Let us see which package provides us ifconfig command using the YUM command.

# yum whatprovides ifconfig

Example output:

CentOS-8 - AppStream                                     1.1 MB/s | 6.3 MB     00:05
CentOS-8 - Base                                          954 kB/s | 7.9 MB     00:08
CentOS-8 - Extras                                        569  B/s | 2.1 kB     00:03
Extra Packages for Enterprise Linux 8 - x86_64           617 kB/s | 3.2 MB     00:05
net-tools-2.0-0.51.20160912git.el8.i686 : Basic networking tools
Repo        : BaseOS
Matched from:
Filename    : /usr/sbin/ifconfig

net-tools-2.0-0.51.20160912git.el8.x86_64 : Basic networking tools
Repo        : BaseOS
Matched from:
Filename    : /usr/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

Example output:

Last metadata expiration check: 0:00:51 ago on Sun 22 Dec 2019 09:07:03 AM EST.
Dependencies resolved.
=========================================================================================
 Package           Arch           Version                           Repository      Size
=========================================================================================
Installing:
 net-tools         x86_64         2.0-0.51.20160912git.el8          BaseOS         323 k

Transaction Summary
=========================================================================================
Install  1 Package

Total download size: 323 k
Installed size: 1.0 M
Downloading Packages:
net-tools-2.0-0.51.20160912git.el8.x86_64.rpm            264 kB/s | 323 kB     00:01
-----------------------------------------------------------------------------------------
Total                                                    148 kB/s | 323 kB     00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                 1/1
  Installing       : net-tools-2.0-0.51.20160912git.el8.x86_64                       1/1
  Running scriptlet: net-tools-2.0-0.51.20160912git.el8.x86_64                       1/1
  Verifying        : net-tools-2.0-0.51.20160912git.el8.x86_64                       1/1

Installed:
  net-tools-2.0-0.51.20160912git.el8.x86_64

Complete!

Once the installation is complete, then run ifconfig to see whether it is available or not.

# ifconfig
View network information with ifconfig command

Conclusion

That’s All. You now have the ifconfig command available on your CentOS 8 / RHEL 8 machine. If you have any questions or feedback, do share it with us in the comment section below.

Exit mobile version