今天用CentOS7安装了操作系统,系统安装时默认是Basic Minimal,所以软件很少,ifconfig命令的软件都没有安装,因此需要自己安装。
[root@localhost /] ifconfig -bash: ifconfig: command not found
使用ip addr命令查看IP,发现没有配置
需要手动去目录/etc/sysconfig/network-scripts配置ifcfg-eth0,配置完重启即可。
ifconfig命令需要安装net-tools
通过yum 命令查找ifconfig时,都找不到
yum provides ifconfig yum search ifconfig
结果都是找不到: no matches found
在网上查找资源,结果net-tools可以找到:
yum list net-tools
所以就直接安装了:
yum install net-tools
安装完成后,就可以直接使用ifconfig命令了。
系统版本:
[root@localhost network-scripts]# cat /proc/version Linux version 3.10.0-693.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Aug 22 21:09:27 UTC 2017
参考:
https://jingyan.baidu.com/article/4853e1e5641c771909f72617.html
https://www.cnblogs.com/zd520pyx1314/p/7956127.html