In Unix and Linux operating systems, device setup (ifconfig) is a command-line utility tool for configuring network interfaces. ifconfig can be considered one of the most useful network tools. The job of these fetches is to transfer important data related to the network to your device so you can check it. This feature used to exist by default in all Linux distributions. However, it is not available by default today. If you try to access your network settings with the ifconfig command on most newly installed Linux systems, you will get an error message, i.e. Ifconfig Command Not Found.  Therefore, it will not be available if you want to use it by the ifconfig command. Don't worry about this error. Here in this article, we will help you to eliminate the error message.

net-tools Package in Linux

If you encounter problems while using the ifconfig utility, it is because of the new policy that we talked about, and it makes you unable to use it by default. So, if you have a question, How to solve the ifconfig Command Not Found, we must say that the solution is to use the net-tools package.

Follow the steps below to install it:

To start, run the terminal and use your usual command corresponding to Linux.

On Debian/Ubuntu derivatives, run:

sudo apt install net-tools

On Arch-based systems, run:

sudo pacman -S net-tools

To install the net-tools package on Fedora, CentOS, and RHEL, issue the following command:

sudo dnf install net-tools

Now you have the net-tools package available on your Linux system. So you will be able to run the ifconfig command.

How to solve the ifconfig Command Not Found

net-tools is usually able to solve your problem easily. However, you may encounter the ifconfig: command is not found again due to certain conditions and reasons. In this case, you must manually update the system PATH and apply the ifconfig binary.

To do this, check if the ifconfig binary exists in the binaries directory. You can do this manually by using the /sbin directory or get help from the cd command. This one-liner also helps you to do the work simply:

[[ -f /sbin/ifconfig ]] && echo "ifconfig exists"

The answer to this command on your system should be "ifconfig exists". If, for any reason, you encounter an error or the desired result is not achieved, you must re-install the net-tools package.

After you have done this section, check the PATH variable using the following command:

echo $PATH

After this step, you should go to /sbin. If, for some reason, you can't find it, use the following command to add /sbin to the PATH:

export PATH = $PATH:/sbin

Now all you have to do is reboot your system. After starting, you will probably find out how to solve the ifconfig Command Not Found.

Alternative method: How to solve the ifconfig Command Not Found error?

For whatever reason, you may want to use ifconfig. This depends on your taste and even your needs. However, it is not bad to use updated alternatives if you can. It is not bad to know that its official replacement is iproute2 after its obsolescence, where you can use ip, cstat, arpd, nstat, devlink, ss, tc. These options will provide you with more possibilities.

The good news is that iproute2 will usually be available by default on Linux. Therefore, you will not have installation and configuration problems. To use it, use the following command:

Install the net-tools kit on your device to correct the ifconfig not found error. Open a terminal window and type net tools.

$ sudo apt-get install net-tools

Suppose you didn't want to use the ifconfig command to look at the network settings. The IP command is another choice for inspecting network settings on your Linux system.

To view a network configuration using the IP command, run the following commands:

# ip address

The IP order above can be shortened to:

# ip a

iproute2 is so useful that it can easily replace ifconfig. You can even access command-line help using the --help flag.


Now you know how to fix the ifconfig command not found error. You can config the ifconfig command as part of the net-tools kit if you still want to use it as part of your regular system admin routine. Otherwise, you can look at the network setup with the IP button. We hope our given information will help you tackle the error message without any trouble.

People are also reading: