Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Fix The ifconfig Command Not Found Error in Linux

October 28, 2022
in Blog, Linux
0
ADVERTISEMENT

Table of Contents

If you encounter the command not found error while using ifconfig, here’s an easy way to solve it.

# ifconfig
-bash: ifconfig: command not found

Ifconfig tool

Ifconfig is a handy networking utility that fetches important data related to the network interface of your machine. It used to come pre-installed in all Linux distributions, that is until it was unanimously declared deprecated by developers due to lack of maintenance.

This is why calling the ifconfig command from the terminal returns an ifconfig: command not found error.

If you still want to use ifconfig on your Linux system, you’ll have to manually install it.

Install the net-tools Package in Linux

If you tried to install the ifconfig utility and failed, it’s because ifconfig cannot be individually installed. It is included with the net-tools package. To be able to use the ifconfig command, you have to install the net-tools package first.

Open up the terminal and run the command corresponding to the Linux distro that you’re currently running:

###Debian/Ubuntu
sudo apt -y install net-tools

###Fedora, CentOS, and RHEL 5/6/7
sudo yum -y install net-tools

###Fedora, CentOS, and RHEL 9 and higher.
sudo dnf -y install net-tools

The installation result in CentOS Stream 9.

# sudo dnf -y install net-tools
...
Installed:
  net-tools-2.0-0.62.20160912git.el9.x86_64

Complete!

This should install the net-tools package on your Linux system, following which you will be able to run the ifconfig command without any errors.

ifconfig
# ifconfig
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.5.91  netmask 255.255.0.0  broadcast 10.10.255.255
        inet6 fe80::20c:29ff:fe8c:67d8  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:8c:67:d8  txqueuelen 1000  (Ethernet)
        RX packets 20435  bytes 24541293 (23.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7888  bytes 620630 (606.0 KiB)
        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<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Alternative to ifconfig and net-tools

While you might find familiarity with ifconfig, it’s recommended you move on to updated tools that offer the same features with better performance.

When the net-tools package was declared deprecated, it was replaced with the iproute2 software suite that includes better alternatives like ip, cstat, arpd, nstat, devlink, ss, tc, and more.

The iproute2 package should already be installed on your Linux machine, so don’t worry about installation or configuration. You can simply run the commands.

To run the alternative to the ifconfig utility, type in this command:

ip a
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:8c:67:d8 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 10.10.5.91/16 brd 10.10.255.255 scope global noprefixroute ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe8c:67d8/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
ADVERTISEMENT
5/5 - (1 vote)
Previous Post

How to Configure Network Connection Using nmcli Tool in Linux

Next Post

Script: How to Install LEMP Stack on CentOS 9/RHEL 9

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

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

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory