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.
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
That’show you can fix the ifconfig command not found 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.
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
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.
- 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)
- 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
- Setting an IP address to network interface
ifconfig eth0 <ip address>
- Assign an netmask to network interface
ifconfig eth0 netmask <netmask>
- Broadcast address to network interface can be assigned as follow.
ifconfig eth0 broadcast <broadcast address>
- 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>
That’s how you can fix ifconfig command not found error Ubuntu. I hope this article helped you. Thank you for reading.