How to Enable ifconfig Command in CentOS7

Some of the issues you may encounter upon installing of CentOS 7 with minimal installation, are running some commands that in the older version of CentOS exist but not in this one. Like a command running “ifconfig” ┬áthis will prompt you a message as:

[root@server1 ~] # ifconfig
- bash : ifconfig : command not found

An alternate command to use instead of ifconfig are “ip addr” or “ip addr sh”

In order for you to have it, you need to search for a packages that provides a certain utility like ifconfig.

You can do “yum provides utility-name” so in our case we do:

[root@server1 ~]# yum provides ifconfig
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.uhost.hk
 * extras: centos.communilink.net
 * updates: centos.uhost.hk
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo        : @base

So you can install the net-tools to use that deprecated utility.

[root@server1 ~]# yum -y install net-tools

You should be able to use ifconfig command after the installation.

 

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.