centos7 重启网卡失败

今天在centOS 7 network服务重启不了

现把各种解决方法归纳整理,希望能让后面的同学少走点歪路。。。

首先看问题:执行service network restart命令后出现下面的错误:

Restarting network (via systemctl): Job for network.service failed because the control process exited with error code.
See "systemctl status network.service" and "journalctl -xe" for details. [失败]
根据提示输入systemctl status network.service命令后出现如下错误信息:
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since 五 2017-07-14 19:01:47 CST; 1min 16s ago
Docs: man:systemd-sysv-generator(8)
Process: 4681 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
CGroup: /system.slice/network.service
└─1192 /sbin/dhclient -H mini1 -1 -q -lf /var/lib/dhclient/dhclient--ens33.lease -pf /v...
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 systemd[1]: network.service: control process exited, code=exited status=1
7月 14 19:01:47 mini1 systemd[1]: Failed to start LSB: Bring up/down networking.
7月 14 19:01:47 mini1 systemd[1]: Unit network.service entered failed state.
7月 14 19:01:47 mini1 systemd[1]: network.service failed.
network服务启动不了首先保证/etc/sysconfig/network-scripts目录下的ifcfg-xxx(每台机器不一定相同)没有错误(如果你改动过的话),这里的错误指的在更改过程中因为手误敲错字母之类的。
网上最常见的几种做法如下:

1.和 NetworkManager 服务有冲突,这个好解决,直接关闭 NetworkManger 服务就好了, service NetworkManager stop,并且禁止开机启动 chkconfig NetworkManager off 。之后重启就好了。

2和配置文件的MAC地址不匹配,这个也好解决,使用ip addr(或ifconfig)查看mac地址

[[email protected] royfans]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:0c:29:5f:9e:1d brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
link/ether 52:54:00:67:8e:c3 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000
link/ether 52:54:00:67:8e:c3 brd ff:ff:ff:ff:ff:ff

00:0c:29:5f:9e:1d这个就是MAC地址了,将/etc/sysconfig/network-scripts/ifcfg-xxx中的HWADDR(如果没有就添加上)改成这个MAC地址

3.设定开机启动一个名为NetworkManager-wait-online服务,命令为:
systemctl enable NetworkManager-wait-online.service

=========================================================================================================

上面两个是我看到最多的解决方法,但是很遗憾,我的并没有解决。

有查看资料,发现了以下一些方法:

4.查看/etc/sysconfig/network-scripts下,将其余无关的网卡位置文件全删掉,避免不必要的影响,即只留一个以ifcfg开头的文件,

5.将ifcfg-xxx文件中的DEVICE一行注释掉。

6.将ifcfg-xxx中的NAME改为和文件名一致。

原文地址:https://www.cnblogs.com/royfans/p/9782840.html

时间: 2024-11-01 15:48:08

centos7 重启网卡失败的相关文章

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

linux下重启网卡使用命令 : service network restart 时报错: [[email protected] hadoop]# service network restart Starting network (via systemctl): Job for network.service failed because the control process exited with error code. See "systemctl status network.servi

Centos重启网卡失败原因

准备重启网卡,用了两条命令都没能成功 [[email protected] Desktop]# ifup eth0Active connection state: activatingActive connection path: /org/freedesktop/NetworkManager/ActiveConnection/1^C** Message: Caught signal 2, shutting down...[[email protected] Desktop]# /etc/ini

centos7重启网卡报Job for network.service failed because...错误

解决: [[email protected] hadoop]# systemctl stop NetworkManager[[email protected] hadoop]# systemctl disable NetworkManager ############## 然后:重启网卡即可:[[email protected] hadoop]# systemctl restart network[[email protected] hadoop]# ifconfig 原文地址:https://

CentOS7 重启网卡Failed to start LSB: Bring up/down networking.解决方法

环境:MAC PD虚拟机安装centos7 修改完网卡配置,重启网络服务报错 使用提示命令查看:systemctl status network.service 发现报错为Failed to start LSB: Bring up/down networking 百度了很多解决办法,无外乎是修改mac地址等,但是修改了并没有什么卵用,最后依靠伟大的谷歌,问题解决 解决方式:禁用NetworkManager 1. systemctl stop NetworkManager 2. systemctl

centos7重启网络失败

问题描述: [[email protected] Desktop]# systemctl start network.serviceJob for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details. 解决方法: 1.HWADDR错误 ,查到正确的HWADDR 输入 ip addr,查找到HWADDR 进入 cd  /etc/sysconfig/networ

VMvare克隆虚拟机之后重启网卡失败

首先 ip addr 查看网卡信息,注意网卡名和mac地址 然后 nmcli con show 查看网卡uuid cd 到 /etc/sysconfig/network-scripts目录, 备份之前的网络文件,eg: cp ifcfg-ens160  /root/ifcfg-ens160 修改网络文件,分别是HWADDR UUID NAME DEVICE 字段 HWADDR修改为上面查看到的mac地址 UUID修改为上面查看到的uuid NAME 和 DEVICE修改为 ip addr 查看到

centos7 重启网卡报错

systemctl restart network 时候报错: rtnetlink answers file exists 是network和NetworkManager冲突了 一般建议直接 systemctl stop NetworkManager systemctl disable NetworkManager

centos7双网卡bond失败

centos7服务器进行双网卡绑定 配置文件 #cat ifcfg-em1 TYPE=Ethernet BOOTPROTO=none DEFROUTE=yes NAME=em1 DEVICE=em1 ONBOOT=yes MASTER=bond0 SLAVE=yes # cat ifcfg-em2 TYPE=Ethernet BOOTPROTO=none IPV4_FAILURE_FATAL=no NAME=em2 ONBOOT=yes MASTER=bond0 SLAVE=yes # cat 

centos7的网卡重启方法

centos6的网卡重启方法:service network restartcentos7的网卡重启方法:systemctl restart network DNS配置文件:cat /etc/resolv.conf设置主机和IP绑定信息:cat /etc/hosts设置主机名:cat /etc/hostname 可以使用nmtui文本框方式修改IP 原文地址:http://blog.51cto.com/andyboge/2073420