Today I will show you how to fix “ifconfig command not found in Minimal Installation in CentOS server.”
As we all know “ifconfig” is a system administration utility in Unix-like operating systems for network interface configuration. It displays the details of a network interface card like IP address, MAC Address, and the status of a network interface card.
ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.
If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays the status of the given interface only; if a single -a argument is given, it displays the status of all interfaces, even those that are down. Otherwise, it configures an interface.
However “ifconfig” is obsolete and is not found in the minimal installation of RHEL 7. Refer the below image:
So the big question is how do I find IP address and other details of a network interface in CentOS Minimal installation server?
Well, this is also very simple. CentOS 7 minimal server use the commands “ip addr” and “ip link” to find the details of a network interface card. There are many other command to check and monitor the network interface. I will add those commands at the last of this post.
To view the details of the network interface card, use the below command:
To view the statistics of the network interfaces, use the below command:
To know the statistics of your network interfaces, use the below command:
ip -s link
Why ifconfig is not present in minimal installation in CentOS7?
Because of the below mentioned reason, you are not seeing ifconfig in your minimal CentOS system.
- Through ifconfig utility, you may find difficulty in configuring and monitor network interface. The ip command is relatively smart and does not require you to type the complete option.
- Other alternative is used to show and manage network interface in a easy manner.
- In minimal installation, only most required packages are installed ( ifconfig does not play much role in network management ). In this way, we can install CentOS in our system, even if we have less memory and hard disk.
You can also manage the network interface using ip utility. The ip utility is a modern utility that can consider advanced networking features that have been introduced recently.
However if you want to use ifconfig utility, you will have to install its package [This post is to educate how we can enable ifconfig utility in minimal version].
How to enable and use “ifconfig” Command in CentOS 7 minimal servers?
To enable and use ifconfig, you shall download the package that provides ifconfig command via yum.
It is also very important to know what package provides ifconfig command. To know this, execute the below command:
yum whatprovides ifconfig
yum provides ifconfig
Once you execute the above command, you will know the name of the package that provides ifconfig command.
In the above image, you can see the package is “net-tools-2.0-0.17.20131004git.el7.x86_64” which provides ifconfig command.
So to enable it, we shall install the above package. Use the below command it install this:
yum install net-tools
Everything is now set up. Now you will be able to use the command “ifconfig“.
For more information about ifconfig command, check the man page.
- Use ip addr or ifconfig to configure and monitor network addresses.
- Use ip route to configure and monitor routing addresses.
- Use ip link to configure and monitor network link state.
- To show current network setting, you can use “ip addr show” or “ip a s” or “ip a“.
Hope you like this post. Share your view in the below comment section.
Powered by Facebook Comments