zoukankan      html  css  js  c++  java
  • Centos7.x系统_网卡启动报错的案例分析

    摘要: 介绍了Centos7系统,网卡启动失败的两种情况,和对应的分析解决方法。

    介绍了Centos7系统,网卡启动失败的两种情况,和对应的分析解决方法。

    情景一:ifconfig 查看不到网卡ip配置,网卡没有正常启动。

    处理过程: 
    1、启动网卡

    systemctl start network
    

    尝试启动网卡,不能正常启动,提示需要执行 "systemctl status network"

    2、执行

    systemctl status network
    
    

    提示错误信息 Failed to start LSB: Bring up/down networking.
    报错提示的不够明确,不能直接判定是什么问题。Google 了一圈这个报错,发现大多都是网卡配置文件配置错误,或者MAC地址不对。
    查看ECS的网卡配置文件内容都正确,网卡配置文件中原先也是没有配置MAC地址,所以排除了网卡配置文件的问题。

    3、继续寻找更详细一些的错误,查看了/var/log/messages 系统日志,在服务器启动的message信息中,发现网卡启动失败的错误,找到了真实的报错。
    image

    错误显示是 ifup 这个命令没有权限执行。

    4、ifup 这个命令,是在 /etc/sysconfig/network-scripts/

    目录中,是一个软连接,实际的文件是 /usr/sbin/ifup
    查看这个文件的权限,果然没有执行权限,

    chmod +x  /usr/sbin/ifup
    

    image

    加上权限后,重启网卡恢复正常。


    情景二: 启动网卡报错: Device eth1 does not seem to be present,delaying initialization

    image

    处理过程:
    1、Device eth1 does not seem to be present,delaying initialization 这个报错,是缺少网卡驱动 virtio_net 导致。
    lsmod 查看系统加载的驱动中,没有virtio_net
    modprobe virtio_net 尝试添加网卡驱动,重启网卡 systemctl restart network 
    还是报错,网卡驱动没有加载成功。

    2、驱动文件都是在 /lib/modules/ 目录下对应内核版本中存放的, 查看服务器中竟然没有 /lib/modules/ 这个目录,/lib 目录中没有系统的库文件,而是一些脚本文件, 肯定是被改过了。

    image

    3、把原目录 /lib 备份一下,然后ln -s /usr/lib /lib 重新软链/lib 目录。

    image

    4、执行 modprobe virtio_net 添加网卡驱动,这次正常加载了。
    最后重启网卡恢复正常。

    image

    本文为云栖社区原创内容,未经允许不得转载,如需转载请发送邮件至yqeditor@list.alibaba-inc.com
  • 相关阅读:
    Sprinig.net 双向绑定 Bidirectional data binding and data model management 和 UpdatePanel
    Memcached是什么
    Spring.net 网络示例 codeproject
    jquery.modalbox.show 插件
    UVA 639 Don't Get Rooked
    UVA 539 The Settlers of Catan
    UVA 301 Transportation
    UVA 331 Mapping the Swaps
    UVA 216 Getting in Line
    UVA 10344 23 out of 5
  • 原文地址:https://www.cnblogs.com/jzy996492849/p/7086304.html
Copyright © 2011-2022 走看看