ifconfig command is useful for getting details of the network configuration in Linux-based systems. Mostly when I install an older version of Linux operating systems, ifconfig command packages were default installed during installation of the operating system but when recently I installed CentOS 7 operating system, ifconfig command was not installed default with operating system installation.
Install Package for ifconfig Command
ifconfig command comes from net-tools rpm package. Install this package using following command which is available under default repositories.
yum install net-tools
Getting Interface Information using ifconfig
Now use ifconfig command to check network configuration details. Below command will show details for all interfaces in system
[root@tecadmin ~]#ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:AC:2D:45 inet addr:192.168.10.100 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:feae:2545/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:877052 errors:0 dropped:0 overruns:0 frame:0 TX packets:840432 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1269001025 (1.1 GiB) TX bytes:61342574 (58.5 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Use below command to show details for interface eth0 in system
ifconfig eth0
To get all interfaces details using ifconfig use following command.
ifconfig -a
2 Comments
Hi Bro,
I have a Question, ” I know the command called “ifconfig” is not installed and i don’t know which package has to be installed to use ifconfig. How to know which package which package that ifconfig includes in centos/RHEL?”
Thanks in advance.
dnf install net-tools