!
也想出现在这里? 联系我们
广告位
当前位置:首页>教程分享>服务器教程>Linux网卡启动报错Job for network.service failed处理方法

Linux网卡启动报错Job for network.service failed处理方法

在运行“/etc/init.d/network restart”命令时,出现错误“Job for network.service failed. See \'systemctl status network.service\' and \'journalctl -xn\' for deta”,运行“cat /var/log/messages | grep network”命令查看日志中出现的与network相关的信息,会发现下面输出语句:

Nov 17 11:31:16 openstack network: Bringing up interface eth0:  Error: no device found for connection \'eth0\'.
Nov 17 11:31:16 openstack network: [FAILED]
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack network: RTNETLINK answers: File exists
Nov 17 11:31:16 openstack systemd: network.service: control process exited, code=exited status=1
Nov 17 11:31:16 openstack systemd: Failed to start LSB: Bring up/down networking.
Nov 17 11:31:16 openstack systemd: Unit network.service entered failed state.

从错误提示“Error: no device found for connection \'eth0\'”可以确定是配置文件eth0的问题,打开查看/etc/sysconfig/network-scripts/ifcfg-eth0文件发现其中的MAC地址和ifconfig命令输出的MAC地址不一样,具体如下所示:

[root@openstack ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=1A:E9:47:A5:75:C8
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPADDR=192.168.1.79
PREFIX=24
GATEWAY=192.168.1.1
DNS1=192.168.1.1
DNS2=8.8.8.8
NAME=eth0
UUID=ba670f0c-201a-483b-8379-c8c72c03ab27
ONBOOT=yes
[root@openstack ~]# ifconfig 
eth0: flags=4163  mtu 1500
       inet 192.168.1.79  netmask 255.255.255.0  broadcast 192.168.1.255
       inet6 fe80::8081:a6ff:fe9d:5887  prefixlen 64  scopeid 0x20
       ether 82:81:a6:9d:58:87  txqueuelen 1000  (Ethernet)
       RX packets 3426  bytes 394042 (384.8 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 57  bytes 9578 (9.3 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

所以只需将ifcfg-eth0中的HWADDR变量值改为ifconfig命令里显示的MAC地址即可。

给TA打赏
共{{data.count}}人
人已打赏
服务器教程

无法在<fastCGI>应用程序配置中找到<handler> scriptProcessor 解决方法

2021-4-17 22:05:31

服务器教程

linux centos7安装完后无法进入图形界面

2021-4-17 22:05:33

声明 本站上的部份代码及教程来源于互联网,仅供网友学习交流,若您喜欢本文可附上原文链接随意转载。无意侵害您的权益,请发送邮件至 [email protected] 或点击右侧 私信:吉吉国王 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
OneEase