ifconfig可显示网卡信息,但是最小化安装的centos7没有ifconfig

centos7没有安装ifconfig的解决办法_ifconfig


思路1-环境变量里没有ifconfig的路径,没有设置环境变量,ifconfig是在/sbin/ 路径下,所以root用户登录运行

centos7没有安装ifconfig的解决办法_ifconfig_02

查看/sbin/路径下有没有ifconfig命令

centos7没有安装ifconfig的解决办法_ifconfig_03

没有则表示centos系统没有安装


思路2-查找安装ifconfig命令依赖的安装包

yum search ifconfig

centos7没有安装ifconfig的解决办法_网卡_04

发现ficonfig命令在net-tools.x86_64包里,安装这个包


yum -y install net-tools.x86_64


net-tools.x86_64包里面有ifconfig,netstat,whois等命令。