As we know, the "ifconfig" command is used to configure the network interface of the Gnu/linux system. It shows the details of the network interface card, including the IP address, MAC address, and network interface card status. However, the command is obsolete and cannot be found in the minimized version of Rhel 7 and its cloned version of CentOS 7,oracle Linux 7 and scientific Linux 7.
How do I find the NIC IP and other details in the CentOS minimized server version?
CentOS 7 minimizes the system by using the "IP addr" and "IP link" commands to find the NIC details. To know the statistics, you can use "ip-s link".
To view the NIC details, enter the following command:
IP addr
Sample output:
1: Lo: <LOOPBACK,UP,LOWER_UP> MTU16436qdisc noqueue State UNKNOWN Link/loopbackxx:xx:xx:xx:xx:xxBrdxx:xx:xx:xx:xx:xxinet127.0.0.1/8Scope host lo inet6::1/ -Scope host Valid_lft forever Preferred_lft forever2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> MTU theqdisc noqueue State UNKNOWN Link/voidinet127.0.0.1/ +Scope host Venet0 inet192.168.1.101/ +Brd192.168.1.101ScopeGlobalVenet0:0
To view network interface statistics, enter a command:
- IP link
Sample output:
16436 Qdisc Noqueue State UNKNOWN mode DEFAULT link /loopback 00 : 00 : 00 : 00 : 00 : XX brd 00 : 00 : 00 : 00 : 00 : 00 2 : venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> MTU 1500 Qdisc Noqueue State UNKNOWN mode DEFAULT link /void
Or
Ip-s Link
Sample output:
1: Lo: <LOOPBACK,UP,LOWER_UP> MTU16436qdisc noqueue State UNKNOWN mode DEFAULT link/loopbackxx:xx:xx:xx:xx:xxBrdxx:xx:xx:xx:xx:xxrx:bytes packets Errors dropped overrun Mcast0 0 0 0 0 0tx:bytes packets errors dropped carrier Collsns0 0 0 0 0 02: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> MTU theqdisc noqueue State UNKNOWN mode DEFAULT link/voidrx:bytes packets Errors dropped overrun Mcast8515667 6667 0 0 0 0tx:bytes packets errors dropped carrier Collsns300403 4249 0 0 0 0
How do I enable and use the "ifconfig" command in the CentOS 7 minimized server version?
If you don't know where to find the Ifconfig command, follow these simple steps to find it. First, let's find out which package provides the Ifconfig command. To complete this task, enter the following command:
Yum provides ifconfig
Sample output:
from Cached Hostfile base: Centos.aol. in * extras:centos.aol. in * updates:centos.aol. inch net-tools-2.0-0.17from/usr/sbin/ifconfig
Or you can use the following command.
Yum Whatprovides ifconfig
Here, the "provides" or "whatprovides" switch is used to find out if a package provides certain features or files.
As you can see in the output above, theNet-tools package provides the Ifconfig command. So let's install the Net-tools package to use the Ifconfig command.
Yum Install Net-tools
Now you can use the ifconfig command as before.
Ifconfig-a
Sample output:
lo:flags= the<UP,LOOPBACK,RUNNING> MTU16436inet127.0.0.1Netmask255.0.0.0Inet6::1Prefixlen -ScopeID0x10Loop Txqueuelen0(Local Loopback) RX packets0bytes0(0.0B) RX Errors0Dropped0Overruns0Frame0TX Packets0bytes0(0.0B) TX Errors0Dropped0Overruns0Carrier0Collisions0Venet0:flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> MTU theinet127.0.0.1Netmask255.255.255.255Broadcast0.0.0.0Destination127.0.0.1Unspecxx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xxTxqueuelen0(unspec) RX packets7073bytes8549159(8.1MiB) RX Errors0Dropped0Overruns0Frame0TX Packets4611bytes359201(350.7KiB) TX Errors0Dropped0Overruns0Carrier0Collisions0venet0:0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> MTU theinet192.168.1.101Netmask255.255.255.255Broadcast192.168.1.101Destination192.168.1.101Unspecxx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xxTxqueuelen0(UNSPEC)
CentOS 7 Minimized installation cannot find ' ifconfig ' command--fix tips