Oct 5, 2020 2 min read

How to Install ifconfig on Debian

Seeing ifconfig command not found error in Debian? Here's how to install ifconfig command on Debian.
Table of Contents

If you are trying to get your IP or network details using the ifconfig command in Debian 10, you'll encounter the 'ifconfig: command not found' error.

-bash: ifconfig: command not found
bash ifconfig command not found in Debian

The ifconfig package is not installed by default on Debian. It's because ifconfig is being deprecated in favor of the new ip command. This ip command is now responsible for modifying or showing routing, network devices, interfaces and tunnels.

If you still want to use the good old ifconfig command, you'll have to install it explicitly.

Installing ifconfig command in Debian

If you try to install ifconfig command directly, your Debian system will not find this package.

[email protected]:~# apt install ifconfig
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ifconfig
Unable to locate package ifconfig in Debian

It is because ifconfig is not a package in its own. It is installed with net-tools package that has some additional networking tools.

So to get ifconfig, you need to install net-tools package like this:

sudo apt install net-tools
Installing ifconfig on Debian

Once installed, you use the ifconfig command:

[email protected]:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        inet6 2400:8966::f03c:92ff:fe32:ffef  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::f03c:99ff:fe32:ffef  prefixlen 64  scopeid 0x20<link>
        ether f2:3c:92:32:ff:df  txqueuelen 1000  (Ethernet)
        RX packets 1623  bytes 421318 (411.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 876  bytes 108871 (106.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet  netmask
        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

However, I strongly advise you should start using the IP command. Sooner or later, net-tools will be completely deprecated and you won't be able to install it.

Abhishek Prakash
Creator of Linux Handbook and It's FOSS. An ardent Linux user & open source promoter. Huge fan of classic detective mysteries from Agatha Christie and Sherlock Holmes to Columbo & Ellery Queen.

Join the conversation

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Linux Handbook.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.