网卡出现问题Job for network.service failed

Posted Felix运维

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了网卡出现问题Job for network.service failed相关的知识,希望对你有一定的参考价值。

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地址不一样,具体如下所示:

[[email protected] ~]# 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

 

 

[[email protected] ~]# 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地址即可






以上是关于网卡出现问题Job for network.service failed的主要内容,如果未能解决你的问题,请参考以下文章

Centos7 网络报错Job for iptables.service failed because the control process exited with error code.

CentOS 1804关机时候出现a stop job is running for GNOME·

两行命令解决Job for network.service failed because the control process exited with error code. 问题

分析ADG网卡流量出现规律性毛刺现象

关于vsftp出现Restarting vsftpd (via systemctl): Job for vsftpd.service failed because the control 的解决办法

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