ifconfig命令是设置或显示网络接口的程序,可以显示出机器的网卡信息,可是在最小化安装的时候会默认不安装ifconfig等命令,此时就需要需要安装一个net-tools的工具包解决此问题。
1、发现现象
[root@localhost yum.repos.d]# ifconfig
-bash: ifconfig: command not found
2、查找安装包
[root@localhost /]# yum list | grep net-tool*
net-tools.x86_64 2.0-0.25.20131004git.el7 @base
3、安装
[root@localhost yum.repos.d]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================================================================== Package Arch Version Repository Size
==============================================================================================================================================================================================================================Installing:
net-tools x86_64 2.0-0.25.20131004git.el7 base 306 k
Transaction Summary
==============================================================================================================================================================================================================================Install 1 Package
Total download size: 306 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.25.20131004git.el7.x86_64.rpm | 306 kB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1
Verifying : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1
Installed:
net-tools.x86_64 0:2.0-0.25.20131004git.el7
Complete!
4、确认
[root@localhost yum.repos.d]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.211.129 netmask 255.255.255.0 broadcast 192.168.211.255
ether 00:0c:29:8c:a6:a4 txqueuelen 1000 (Ethernet)
RX packets 248246 bytes 344824443 (328.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 54154 bytes 4958022 (4.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 1000 (Local Loopback)
RX packets 16 bytes 1392 (1.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 16 bytes 1392 (1.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0