centos7新安装的时候,ifconfig提示command not found
新安装的centos7 输入ifconfig提示错误
由于是最小化安装的centos,所以网卡没有**
而且在sbin目录中没有ifconfig文件,这是因为CentOS 7已经不使用 ifconfig命令了,已经用ip命令代替;
并且网卡名称也不是eth0了,而是改成enp0s3了。
- 进入 /etc/sysconfig/network-scripsts/
解决ifconfig不可用:ip addr 即查看分配网卡情况。
**网卡:在文件 /etc/sysconfig/network-scripts/ifcfg-enp0s3 中
进入编辑模式,将 ONBOOT=no 改为 ONBOOT=yes,就OK
保存后重启网卡: service network restart
2. ifconfig不可用
安装net-tools
执行命令:yum install net-tools