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. 如何配置virtualBox端口转发

    1,第一步登陆虚拟主机,安装openssh-server(这一步非常重要,如果不安装,你在宿主机上怎么链接都是连不上的,我当时就犯了这个错误) apt-get install openssh-serv ...

  2. bestcoder Round #7 前三题题解

    BestCoder Round #7 Start Time : 2014-08-31 19:00:00    End Time : 2014-08-31 21:00:00Contest Type : ...

  3. CRect类

    类CRect是对Windows结构RECT的封装,凡是能用RECT结构的地方都可以用CRect代替. 结构RECT表示一个矩形的位置和尺寸,其定义为: typedef struct tagRECT{ ...

  4. HTML5+CSS3+jquery实现简单的音乐播放器

    ...最近天热的,感觉就像煎饼...然后别人在把妹子的时候,只有偶们这帮苦逼的程序员在那边撸代码...我日哦! 然后今天晒的是偶早年写的一个播放器...看上去是不是很有感觉的样子!一番宝物,Lisa唱 ...

  5. 字符编码-UNICODE,GBK,UTF-8区别【转转】

    字符编码介绍及不同编码区别 今天看到这篇关于字符编码的文章,抑制不住喜悦(总结的好详细)所以转到这里来.转自:祥龙之子http://www.cnblogs.com/cy163/archive/2007 ...

  6. html 框架

    通过使用框架,你可以在同一个浏览器窗口中显示不止一个页面. 本例演示:如何使用三份不同的文档制作一个垂直框架. <html> <frameset cols="25%,50% ...

  7. Linux下运行C语言程序

    一.编写C语言的源代码 二.用gcc -c C文件名生成.o文件 三.用gcc -o 可执行文件名 .o文件名 生成可执行文件 四.输入可执行文件名前加./执行可执行文件

  8. loadrunner-27796错误寻求解决办法

    Action.c(58): Error -27796: Failed to connect to server "www.baidu.com:80": [10048] Addres ...

  9. .NET异步编程之回调

    C#中异步和多线程的区别是什么呢?异步和多线程两者都可以达到避免调用线程阻塞的目的,从而提高软件的可响应性.甚至有些时候我们就认为异步和多线程是等同的概念.但是,异步和多线程还是有一些区别的.而这些区 ...

  10. windows 下wamp环境1 配置之apache的安装

    一.安装apache2.4 打开网站 apachelounge.com    https://www.apachelounge.com/ 点击左侧Downloads,然后选择对应的版本,这里选择Apa ...