Install ifconfig on CentOS 7
Missing ifconfig command on your CentOS 7 server? This post helps you to install ifconfig on CentOS 7.
You may noticed the following error while executing the ifconfig command on CentOS 7 server. This error is due to the ifconfig is not installed on it.
[root@server ~]# ifconfig -bash: ifconfig: command not found [root@server ~]#
You can use “ip” command to find the details of a network interface card. Please see the sample output below:
[root@server ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN link/void inet 127.0.0.1/32 scope host venet0 inet 192.168.1.10/32 brd 192.168.1.10 scope global venet0:0 [root@server ~]#
Install ifconfig
If you wish to enable ifconfig command, you just need to install net-tools package using yum.
yum install net-tools
Now, you will be able to use ifconfig.
[root@server ~]# ifconfig lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 8 bytes 790 (790.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 8 bytes 790 (790.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 venet0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500 inet 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0 destination 127.0.0.1 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC) RX packets 455616 bytes 175306713 (167.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 344749 bytes 46182190 (44.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 venet0:0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500 inet 192.168.1.10 netmask 255.255.255.255 broadcast 192.168.1.10 destination 192.168.1.10 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC) [root@server ~]#
That’s it!
Also Read: Install SAR (sysstat) on CentOS
If you like this post and wish to receive more articles from us, please like our FB page: GrepItOut
Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.
For more details on our services, please drop us an E-mail at info@grepitout.com
Add Comment