CentOS开机eth0网络设备不启动

新装一个CentOS系统,开机发现没有网络,于是ifconfig一下发现eth0设备网络没有启动

[root@lee ~]# ifconfig
lo  Link encap:Local Loopback  
    inet addr:127.0.0.1  Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING  MTU:16436  Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0 
    RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

直接重启网络服务

[root@lee ~]# service network restart
关闭环回接口:                                             [确定]
弹出环回接口:                                             [确定]

发现提示命令中并没有,并没有开启eth0的提示。直接找到脚本

[root@lee ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes确认已经打开!

reboot重启系统,还是不管用。每次都要手动开启设备

[root@lee ~]# ifup eth0

于是在/etc/rc.local里加入/sbin/ifup eth0,问题暂时解决了。但还是不明白为何需要这样开启!

分享

TITLE: CentOS开机eth0网络设备不启动

LINK: https://www.qttc.net/321-centos-boot-no-eth0.html

NOTE: 原创内容,转载请注明出自琼台博客