天天看点

CentOS 7 ifconfig command not found

刚安装CentOS7由于无法使用ifconfig查看ip,也无法ping通其它ip及外网

通过上网查看一大堆资料,终于找到了一个解决了问题

资料地址:https://www.cnblogs.com/dunitian/p/4974761.html

解决的问题的是解决方案3

在 /(根目录)里面查找 name(名字)是 ifconfig 的东东

CentOS 7 ifconfig command not found

说明ifconfig真的换了,淡定

看看信息

ip addr
           

发现没有(看 2:eth0 没有ipv4)

CentOS 7 ifconfig command not found

跳转到 /etc/sysconfig/network-scripts 目录

cd /etc/sysconfig/network-scripts
           

用vi打开 ifcfg-eth0 (你的可能是eth1,或者其他,不是每个电脑都是这个的)【如果想改成这个可以参考:http://jingyan.baidu.com/article/7f41ecec1b022e593d095c1e.html】

CentOS 7 ifconfig command not found
CentOS 7 ifconfig command not found

按 i 进去编辑模式 ,修改箭头处,然后按 esc 退回命令模式,输入:wq 并回车

CentOS 7 ifconfig command not found

重启一下 

reboot
           

用root用户登陆后 输入 

CentOS 7 ifconfig command not found
CentOS 7 ifconfig command not found

也能ping通百度了

CentOS 7 ifconfig command not found

继续阅读