WORKS FOR iPhone 14/iPhone 13/13 Pro 6.1 Inch Display Screen 0.33mm tempered glass screen protector. Featuring maximum protection from scratches, scra... read more
As a Linux system administrator or power user, you likely use the ifconfig command on a regular basis to view network interface configurations. However, you may encounter the frustrating “ifconfig: command not found” error when trying to run it.
This common issue occurs because the ifconfig utility is not installed by default on some Linux distributions anymore. But the good news is, fixing this problem is quite simple!
In this article, I’ll explain step-by-step how to install ifconfig and permanently enable the command on your system. I’ll also cover some extra troubleshooting tips in case you run into any other issues getting ifconfig to work properly.
Why Am I Seeing “ifconfig command not found”?
First, let’s discuss why this error happens in the first place.
The ifconfig command has been around for decades and was previously included in most Linux distros by default. However, in recent years many distributions like Ubuntu and Fedora have replaced it with a newer command called ip.
The ip tool performs similar functions to ifconfig such as displaying network configuration details. But it’s considered more modern and versatile.
So for that reason, newer Linux versions no longer install ifconfig automatically. That’s why running the standard ifconfig command results in a “command not found” error.
However, many admins still prefer using good old ifconfig out of habit or convenience. So let’s look at how to quickly get ifconfig set up on your system.
Method 1: Installing ifconfig Package
The easiest way to enable the ifconfig command is by installing its package that contains the ifconfig binary.
For Debian-based distros like Ubuntu, you just need to use apt:
The ifconfig tool is bundled in the net-tools package, so this automatically enables the ifconfig command.
On RHEL-based distros including CentOS, use yum to install net-tools:
For RPM-based distros like Fedora, install net-tools using dnf:
And that’s it! Installing the net-tools package makes the ifconfig command accessible on all major Linux distributions.
Method 2: Create a Symbolic Link
Alternatively, you can enable ifconfig by creating a symbolic link to the ip command, which has similar functionality.
Here is how to set up a symlink for ifconfig manually:
sudoln -s /usr/sbin/ip /usr/bin/ifconfig
Now running ifconfig will execute the ip tool instead, essentially giving you access to ifconfig again!
The benefit here is you don’t need to install any additional packages. However, the output format of ip isn’t exactly the same as the traditional ifconfig command.
Still, creating a quick symlink gets ifconfig working again on your system. And you always have access to the full ip tool for more advanced network management.
Testing and Verifying ifconfig
After installing ifconfig using either method above, verify it is now enabled by running:
You should see the standard output displaying details about your network interfaces:
Hopefully with some debugging, you’ll have the trusty ifconfig command working correctly on your system once again!
Although ifconfig has largely been deprecated, many Linux admins still find it useful for examining network configurations.
When running into a “command not found” error, first install the net-tools package containing ifconfig using your distro’s package manager.
Alternatively, create a symbolic link from ifconfig to ip for basic functionality.
With ifconfig enabled again on your system, you can easily view your NIC names, IP addresses, subnet masks, and more. No need to struggle with the newer ip command if you prefer using old reliable ifconfig instead!
Fixing the “ifconfig not found” error ultimately comes down to properly installing its package or symlinking the ip command. With the simple solutions in this guide, you’ll be back to using ifconfig in no time.
Greetings! I am Ahmad Raza, and I bring over 10 years of experience in the fascinating realm of operating systems. As an expert in this field, I am passionate about unraveling the complexities of Windows and Linux systems. Through WindowsCage.com, I aim to share my knowledge and practical solutions to various operating system issues. From essential command-line commands to advanced server management, my goal is to empower readers to navigate the digital landscape with confidence.
Join me on this exciting journey of exploration and learning at WindowsCage.com. Together, let’s conquer the challenges of operating systems and unlock their true potential.