ifconfig command not found - Centos 7

Page content

How to Install ifconfig Command on CentOS 7

If you are using CentOS 7 and find that the ifconfig command is not available, it is because the traditional ifconfig command has been deprecated in favor of the ip command. Here’s how you can install and use the equivalent command ip on CentOS 7.

Installing the ip Command on CentOS 7

You can install the ip command by installing the iproute package. To do this, follow these steps:

sudo yum install iproute

If the iproute package is not available in the default repositories, you can enable the EPEL repository to install it:

sudo yum install epel-release
sudo yum install iproute

Using the ip Command

Once you have installed the ip command, you can use it in place of ifconfig. Here are some examples of how you can use the ip command:

To display network interfaces:

ip a

To show routing table:

ip route

To bring an interface up or down:

sudo ip link set dev <interface> up
sudo ip link set dev <interface> down

Conclusion

In CentOS 7, the ifconfig command has been replaced by the more versatile and powerful ip command. By following the steps outlined in this tutorial, you can easily install and use the ip command to manage network interfaces and configurations on your CentOS 7 system.