centos7网卡是需要写入MAC地址的不然启动不了

在运行“/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<UP,BROADCAST,RUNNING,MULTICAST>  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<link>

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地址即可

CentOs7 网卡出现问题Job for network.service failed的更多相关文章

  1. Centos7 虚拟机复制后网卡问题 Job for network.service failed

    在运行“/etc/init.d/network restart”命令时,出现错误“Job for network.service failed. See 'systemctl status netwo ...

  2. Linux 重启网卡失败 Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

    linux下重启网卡使用命令 : service network restart 时报错: [root@slave01 hadoop]# service network restart Startin ...

  3. linux网卡出现问题:Job for network.service failed because the control process exited with error code问题

    [转自]:https://blog.csdn.net/dongfei2033/article/details/81124465 今天在centOS 7下更改完静态ip后发现network服务重启不了, ...

  4. centos上网络服务起不来network.service failed

    前言:今天在开虚拟机,额,,,crt连不上虚拟机了,ping不通,说明虚拟机网卡挂了,去后台看下 发现报错: Job for network.service failed because the  c ...

  5. Job for network.service failed because the control process exited with error code

    转自:https://blog.csdn.net/dongfei2033/article/details/81124465 今天在centOS 7下更改完静态ip后发现network服务重启不了,翻遍 ...

  6. Job for network.service failed because the control process exited with error code问题

    Job for network.service failed because the control process exited with error code问题 因为是克隆的,所以需要重新修改静 ...

  7. kali linux重启网卡失败:Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details. 问题排查

    linux菜鸡的时候,总是为了配置网络而烦恼,重启网卡的原因有很多,我这次是因为配置了固定IP[使用第三方工具连接]所以需要重启网卡,出现 Job for networking.service fai ...

  8. CentOS 7 配置静态IP后不生效 & Job for network.service failed

    参考:http://tieba.baidu.com/p/3233996339#57290767555l 在CentOS中配置静态IP后不生效. 解决办法:将/etc/sysconfig/network ...

  9. centos7启动iptables时报Job for iptables.service failed because the control process exited with error cod

    centos7启动iptables时报Job for iptables.service failed because the control process exited with error cod ...

随机推荐

  1. webapp开发要点记录

    1. iphone 各机型 机型 分辨率 像素比 物理分辨率 高* 宽 * 后 主屏对角线长度 重量 像素密度(ppi) iphone4/iphone4s 320 * 480 2 640 * 960 ...

  2. [设计模式] javascript 之 组合模式

    组合模式说明 组合模式用于简单化,一致化对单组件和复合组件的使用:其实它就是一棵树: 这棵树有且只有一个根,访问入口,如果它不是一棵空树,那么由一个或几个树枝节点以及子叶节点组成,每个树枝节点还包含自 ...

  3. JavaScript数组属性与方法

    Array 对象属性 属性 描述 constructor 返回对创建此对象的数组函数的引用. length 设置或返回数组中元素的数目. prototype 使您有能力向对象添加属性和方法. Arra ...

  4. [转]C++模板学习

    1. 模板的概念. 我们已经学过重载(Overloading),对重载函数而言,C++的检查机制能通过函数参数的不同及所属类的不同.正确的调用重载函数.例如,为求两个数的最大值,我们定义MAX()函数 ...

  5. Ubuntu/Windows下利用“HIDAPI”库函数实现与Hid类USB设备通信

    一.背景: 最近在做的一个项目需要使用USB传递数据,对USB理解不是很深,USB的系统驱动编写则更是天方 夜谭,因此将设备配置成HID类设备成为了首选.其最大的好处在于,LINUX/Windows系 ...

  6. “北航Clubs”功能规格说明书

    1.项目目标说明: 北航Clubs的初衷是服务社团,服务学生,满足社团与学生的信息互通的需求.社团管理运营方便的需求. 建设网站的目的是使学生可以在一个权威可信的网站上获取到社团实时的动态,社团活动的 ...

  7. Java之enumeration(枚举)

    enumeration(枚举)是JDK1.5引入的新特性,放在java.lang包中. 1.枚举类方法介绍 package com.enums; public class TestEnum { pub ...

  8. C++中的单例模式(转)

    单例模式也称为单件模式.单子模式,可能是使用最广泛的设计模式.其意图是保证一个类仅有一个实例,并提供一个访问它的全局访问点,该实例被所有程序模块共享.有很多地方需要这样的功能模块,如系统的日志输出,G ...

  9. Lua模块测试

    Lua模块 ---------------------------------------------------------- ----------------------- 模块测试module_ ...

  10. nginx命令

    window  cmd 到nginx的文件夹 start nginx    启动命令 nginx -s reload 重新启动 nginx -s stop   关闭   linux   到 sbin ...