zoukankan      html  css  js  c++  java
  • CentOS 下网络报错 Device eth0 does not seem to be present

    在执行network服务重启后,出现Device eth0 does not seem to be present  问题,主要是因为系统之前有多个网卡配置,和配置文件不匹配造成的。

    解决这种问题,思路是先看系统网卡配置文件中目前的配置情况,然后再在网络配置文件中修改相应的配置

    具体现象:

    service network restart
    Shutting down loopback insterface:                                                                                                     [  OK  ]
    Bringing up loopback insterface:                                                                                                          [  OK  ]
    Bringing up interface eth0:  Device eth0 does not seem to be present,delaying initialization.                     [FAILED]

    解决办法:

    1、查看网络配置文件

    cat /etc/udev/rules.d/70-persistent-net.rules

    # This file was automatically generated by the /lib/udev/write_net_rules
    # program, run by the persistent-net-generator.rules rules file.
    #
    # You can modify it, as long as you keep each rule on a single
    # line, and change only the value of the NAME= key.
    
    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:6f:02:c2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
    
    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d0:74:01", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
    
    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:bc:4e:d6", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
    
    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:78:35:ae", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

    在使用ifconfig命令执行后,显示的网卡为最后一个eth3,现在我们不需要eth3,想改回eth0。在/etc/sysconfig/network-scripts/文件夹中只有ifcfg-eth0

    # This file was automatically generated by the /lib/udev/write_net_rules
    # program, run by the persistent-net-generator.rules rules file.
    #
    # You can modify it, as long as you keep each rule on a single
    # line, and change only the value of the NAME= key.
    
    # PCI device 0x8086:0x100f (e1000)
    #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:6f:02:c2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
    
    # PCI device 0x8086:0x100f (e1000)
    #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d0:74:01", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
    
    # PCI device 0x8086:0x100f (e1000)
    #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:bc:4e:d6", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
    
    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:78:35:ae", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    最后条记录是目前在用的网卡的数据,包括mac地址信息,需要把最后一条的网卡名称从eth3,改成eth0,然后修改ifcfg-eth0

    DEVICE="eth0"
    BOOTPROTO="static"
    HWADDR="00:0c:29:78:35:ae"
    IPV6INIT="yes"
    NM_CONTROLLED="yes"
    ONBOOT="yes"
    TYPE="Ethernet"
    NETMASK=255.255.255.0
    IPADDR=192.168.114.128
    GATEWAY=192.168.114.1

    吧hwaddr改成70-persistent-net.rules文件中最后一条记录的mac地址。

    重启修改成功。

    注意:

    如果没有关闭NetworkManager,则需要关闭

    service NetworkManager stop

    chkconfig NetworkManager off

  • 相关阅读:
    python threading模块中对于信号的抓取
    docker挂载NVIDIA显卡运行pytorch
    更换HomeBrew源
    IX-Protected Dataplane Operating System解读
    NFV、DPDK以及部分用户态协议研究
    (一)最小的Django
    (二)无状态的web应用(单py的Django占位图片服务器)
    Windows7 64位环境下Python-igraph环境配置
    关于docker使用的几个小问题(二)
    关于docker使用的几个小问题(一)
  • 原文地址:https://www.cnblogs.com/qpanda/p/5112831.html
Copyright © 2011-2022 走看看