The ifconfig command is a useful utility to display and set network configuration on Ubuntu and Debian Linux systems. This command is available under the net-tools
package is replaced with modern iproute2
Debian packages.
When your type ifconfig
command on the latest operating systems, you will get the following error on Ubuntu and Debian-based systems.
-bash: ifconfig: command not found
Install net-tools Package
The ifconfig binary file comes with the net-tools Debian package. Install this package using the following command which is available under default repositories.
sudo apt-get install net-tools
Using ifconfig
Then you can use this command to check network configuration details. The below command will show details for all interfaces configured on your Debian system.
ifconfig
Output:eth0: flags=4163mtu 1500 inet 206.81.1.33 netmask 255.255.240.0 broadcast 206.81.15.255 inet6 fe80::6cdc:96ff:fe05:82a8 prefixlen 64 scopeid 0x20 ether 6e:dc:96:05:82:a8 txqueuelen 1000 (Ethernet) RX packets 43032855 bytes 6789955172 (6.7 GB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 38997280 bytes 38954070507 (38.9 GB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth1: flags=4163 mtu 1500 inet 10.136.0.2 netmask 255.255.0.0 broadcast 10.136.255.255 inet6 fe80::14d4:5eff:fe05:e5ed prefixlen 64 scopeid 0x20 ether 16:d4:5e:05:e5:ed txqueuelen 1000 (Ethernet) RX packets 311 bytes 21770 (21.7 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 327 bytes 22986 (22.9 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 700780899 bytes 2751296590452 (2.7 TB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 700780899 bytes 2751296590452 (2.7 TB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Use below command to show details for interface eth0 in system
ifconfig eth0
To get all interfaces details using ifconfig use the following command.
ifconfig -a
Conclusion
This tutorial helped you to resolve -bash: ifconfig: command not found
error on an Ubuntu and other Debian-based systems.
4 Comments
Thanks for the great answer!
It’s a great utility to get network configuration details on Debian Linux system.
The ifconfig command was not installed default with Debian, because of net-tools has been obsolete by iproute2 in 2009: https://lists.debian.org/debian-devel/2009/03/msg00780.html
You should to use default iproute2, not install old, not development and security risk net-tools.
Poor article, do not learn people how to use old and security risk tools.
TY Preter you are correct. 5 thumbs up