ifconfig Command Not Found in Centos 7

Help! When I type “ifconfig” in Centos 7 and it returned “Command Not Found”. No worry, your CentOS 7 is not broken, it’s a minimal installation and ifconfig command doesn’t come with CentOS 7 minimal install.

To bring back “ifconfig” command, follow the quick steps below;

1. Use “yum provides” command to look for what package provide ifconfig command

# yum provides ifconfig
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.easynews.com
 * extras: repos.lax.quadranet.com
 * updates: centos.mirror.ndchost.com
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo        : base
Matched from:
Filename    : /sbin/ifconfig

install-ifconfig-on-centos-7-02

2. The returned result show “net-tools” provide ifconfig command, that is what we need to install!

[[email protected] ~]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.easynews.com
 * extras: repos.lax.quadranet.com
 * updates: mirrors.cat.pdx.edu
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
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm                                                        | 304 kB  00:00:02
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!

install-ifconfig-on-centos-7-01

3. Done with the installation, next run “ifconfig” command and confirm “command not found” is not happening again 😉

# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
        inet 10.240.126.164  netmask 255.255.255.255  broadcast 10.240.126.164
        inet6 fe80::4001:aff:fef0:7ea4  prefixlen 64  scopeid 0x20
        ether 42:01:0a:f0:7e:a4  txqueuelen 1000  (Ethernet)
        RX packets 128223  bytes 193257182 (184.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 90742  bytes 9124218 (8.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 20  bytes 1784 (1.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 1784 (1.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

install-ifconfig-on-centos-7-03

Cool? No more “Command not found” error when run “ifconfig” command in CentOS 7.

Video: How to Install ifconfig on CentOS 7