ifconfig is a -line utility to view network interfaces attached to machines and network information such as 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.

When you do a minimal installation of  8 / 8, you might get an error like command not found when you run ifconfig command.

-bash: ifconfig: command not found
ifconfig command not found

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

Install ifconfig Package

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

yum whatprovides ifconfig

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 :   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
ifconfig package name

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:

Last metadata expiration check: 0:00:51 ago on Mon 04 Nov 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  size: 323 k
Installed size: 1.0 M
Downloading Packages:
net-tools-2.0-0.51.20160912git.el8.x86_64.            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!
net-tools package installed

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

ifconfig

Output:

View network information with ifconfig command

Conclusion

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

How to fix netstat Command not found on CentOS 8 / RHEL 8

Print Friendly, PDF & Email

Comments

comments

Bài viết liên quan