How to Install ifconfig on Debian 12

The ifconfig command utility is used for the configuration of the network interfaces on Debian distributions. It is used to explore the current configuration of the networks as well as to configure the new interfaces. It is also commonly used to assign a new IP address to the interface. 

It is also used to find out the MAC address, IP address, network routes, and MTU on Debian Linux. This article will help users to understand the installation, usage, and uninstallation of the ifconfig command on Debian.

The outline of this blog is explained below:

  1. What is the Installation Method of ifconfig Command on Debian
  2. What is the General Usage Syntax of ifconfig Command on Debian
  3. What is the Common Usage of the ifconfig Command on Debian
  4. [Fixed] ifconfig command not found in Debian
  5. What is the Uninstallation Method of ifconfig Command on Debian

What is the Installation Method of ifconfig Command on Debian?

If the ifconfig command utility is not installed on Debian, then run the commands explained in the next steps after launching the terminal.

Step 1: Upgrade the Package List

The first step is to find out the new updates of the software available in the package list of Debian by running the command:

$ sudo apt update

Install the new available updates with the following command:

$ sudo apt upgrade -y

Step 2: Install the net-tools Package

The ifconfig command utility is included in the net-tools package of Debian’s package list. If the package of the net-tools is installed, then the users will be able to use the ifconfig command. 

To install the net-tools package on Debian, use the command:

$ sudo apt install net-tools -y

After the successful installation of the “net-tools” package on Debian, the ifconfig command is successfully installed on Debian. 

What is the General Usage Syntax of ifconfig Command on Debian?

To use the ifconfig command on Debian, follow the next-mentioned general syntax of the ifconfig command:

$ sudo ifconfig [options] interface

There are multiple options of the ifconfig command that can be used with the ifconfig command for different purposes. All these options can be found by reading the manual of the ifconfig command with the following command:

$ man ifconfig

What is the Common Usage of the ifconfig Command on Debian?

The ifconfig command utility is used for multiple applications, common usage of the ifconfig command is explained in this section. 

Display the Network Interfaces

It is used to display the available network interfaces on the terminal by running the command:

$ sudo ifconfig -a

Enable/Disable the Network Interfaces

To enable the network interfaces on Debian, use the ifconfig command with its “up” option:

$ sudo ifconfig enp0s3 up

Similarly, the “down” option is used to disable the network interface as shown:

$ sudo ifconfig enp0s3 down

[Fixed] ifconfig command not found in Debian

Sometimes Debian users face the “ifconfig command not found” on Debian which can be frustrating for them. 

The first method to resolve this issue is by installing the net-tools package on Debian by following the steps mentioned in this post. 

If still, the issue remains, then it is recommended to go through the mentioned blog and follow the instructions explained in it. 

What is the Uninstallation Method of ifconfig Command on Debian?

To uninstall the ifconfig command, the users are supposed to remove the package of the net-tools. 

Before proceeding with this method, it should be kept in mind that the net-tools package contains some other network command utilities such as hostname. With the removal of the net-tools, all the other command utilities included in the net-tools package will be removed. 

If still users want to delete the ifconfig command, then use the purge option of the apt command as shown:

$ sudo apt purge net-tools -y

This is all about the installation and usage of the ifconfig command on Debian. 

Conclusion

To install the ifconfig command on Debian, run the “sudo apt install net-tools -y” in the terminal. This package will install the ifconfig command on Debian and other Linux distributions. 

The ifconfig command is also known as the interface configuration because it is used to configure the network interfaces on Debian.

This post has explained the installation, usage, and uninstallation method of the ifconfig command on Debian with examples.