The use of Linux commands is the essence of this system, because thanks to them we can execute hundreds of informative, administrative and support orders allowing to carry out a large number of tasks in a safe and practical way . In all this information world of a Linux system , one of the most relevant areas is that of networks since a server or computer without a network connection simply cannot perform all the tasks for which it was designed, so it is that as Linux administrators or users is vital to know how the network is configured and this is achieved thanks to the "ifconfig" command..
What is the ifconfig command
The ifconfig (interface configuration) command is a command that has been developed with the objective of providing control over the network in aspects such as its configuration, administration as well as obtaining details of the parameters of the network interface using the line interface of commands or in a system configuration script if applicable.
Ifconfig command options
There are some options that we can use with the ifconfig command in these distributions such as:
- -a: display all available interfaces
- -s: display the results in short format
- -v: display the results in “verbose†or summary mode
- up: used to activate the controller for the selected interface
- down: it is used to deactivate the controller for the selected interface
- add addr / prefixlen: allows you to add an IPv6 address to the interface
- from addr / prefixlen: disable the IPv6 address on the selected interface
- [-] arp: allows or not to enable the ARP protocol in the interface
- [-] allmulti: enable or not the multicast mode on the interface
- mtu N: allows you to define the parameter in order to set the Maximum Transfer Unit (MTU)
- --help: display command help
TechnoWikis will explain how to install this “ifconfig†command in some of the most popular distributions and then we'll see how to use it.
To keep up, remember to subscribe to our YouTube channel! SUBSCRIBE
1. Install ifconfig on CentOS 8
CentOS 8, like Red Hat, are the two most special distributions for a corporate environment for security issues and integrated functions, so ifconfig is more than essential to know the state of the network in real time.
Step 1
The ifconfig command is integrated from a system utilities package, to know what that package is we can execute the following:
yum whatprovides ifconfig
Step 2
As a result, we see that the net-tools package is the one that contains the ifconfig command, to install this series of utilities we will execute the following:
sudo yum -y install net-tools
Step 3
Once installed we can run it directly to see the status of the network interface:
2. Install ifconfig on Debian 11
Debian 11 is the next available version of this system and as such is one of the most popular Linux distributions.
Step 1
By default this ifconfig command is not installed and we will see the following if you try to execute:
..
Step 2
To install the ifconfig command there, the first thing to do will be to update the system packages:
apt update
Step 3
After the packages are updated we will install the Net-tools by executing the following:
apt install net-tools
Step 4
To execute the ifconfig command on Debian 11 we will execute the following:
sbin / ifconfig
3. Install ifconfig on Ubuntu 20
Ubuntu is the most popular distribution of Linux and we are at the door of the release of version 20.04.
Step 1
Like the previous distributions, ifconfig is not installed by default:
Step 2
Luckily, the instructions for installation are indicated right there, but we advise you to first update the system packages by running:
sudo apt update
Step 2
Then we install the utilities with the following order:
sudo apt install net-tools
Step 3
Once installed we can execute the ifconfig command with total security:
Step 4
To determine the location of ifconfig we will execute the following command:
which ifconfig
As we can see, with the ifconfig command it will be possible to access specific details of the network interface used in Linux and thus determine precisely the current state of it.