Interface configuration (ifconfig) is a command line utility tool used to configure network interfaces in Unix and Linux operating systems.

In most of the newly installed Linux systems if you tried to view your network configurations using the “ifconfig” command you’ll be prompted with an error as shown in the below screenshot.

Command ‘ifconfig’ not found error in Ubuntu

You’re getting this error because the latest Ubuntu releases does not have a package called “net-tools”. Reason for not including this package in latest Ubuntu releases is because ifconfig command has been deprecated.

Even though this command does not installed by default, if you really want to work with this old command “ifconfig” you can install the net-tools package using the below command and you are good to go.

sudo apt install net-tools
Installing net-tools package in Ubuntu
Installing net-tools package in Ubuntu

That’show you can fix the ifconfig command not found in Ubuntu.

ifconfig command in Ubuntu

So let’s say that you wanted to examine you network configurations without using the “ifconfig” command. The alternative way to examine the network configurations on your Ubuntu system is “ip” command.

ip a command
ip a command

You can read the man page of this command if you like learn more advance about this command. Use one of the below command to display your network configurations.

ip a
ip address 
Check network configurations using ip command
Check network configurations using ip command

Also Read: How To Fix Sudo Command Not Found in Debian

Here are some options that you can try with ifconfig Command

  • To view information of all active and inactive interfaces use ifconfig command together with “-a” option.
ifconfig -a
ipconfig -a command
  • If you want view information related to a specific interface use the ifconfig command together with the interface name that you want to check. (In this case ens33 is my specific interface)
ifconfig ens33
  • By using ifconfig command together with the interface name and “up” or “down ” flag activates or deactivates the specified network interface. We can also use “ifup” or “ifdown” together with the interface name to activates or deactivates the specified network interface.
ifconfig eth0 up or ifup eth0
ifconfig eth0 down or ifdown eth0
Activating and deactivating network interfaces using ifconfig
  • Setting an IP address to network interface
ifconfig eth0 <ip address>
Setting an IP address to network interface using ifconfig
  • Assign an netmask to network interface
ifconfig eth0 netmask <netmask>
Setting an netmask to network interface using ifconfig
  • Broadcast address to network interface can be assigned as follow.
ifconfig eth0 broadcast <broadcast address>
Setting an broadcast address to network interface using ifconfig
  • We can also assign the IP address, netmask and broadcast address all at once using the following command.
ifconfig eth0 <ip address here> netmask <netmask here> broadcast <here>
Configuring IP address, netmask and broadcast address using ifconfig

That’s how you can fix ifconfig command not found error Ubuntu. I hope this article helped you. Thank you for reading.

Write A Comment