web123456

CentOS 7.2 restart network error Failed to start LSB: Bring up/down---liux error

vi /etc/sysconfig/network-scripts/ifcfg-eno16777736name and device, and change the configuration file name to ifcfg-eth0. Restart the network: systemctl restart . Later, due to the failed restart, I restored to the original information and thought it would be normal, but it still did not solve it.

# systemctl restart
Job for failed because the control process exited with error code. See "systemctl status " and "journalctl -xe" for details.

View network card information according to the prompt
# systemctl status

View log
# cat /var/log/messages |grep network
Jul  4 10:05:10 dg-p systemd: Starting LSB: Bring up/down networking...
Jul  4 10:05:10 dg-p network: Bringing up loopback interface:  Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Jul  4 10:05:10 dg-p network: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Jul  4 10:05:10 dg-p network: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Jul  4 10:05:10 dg-p network: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Jul  4 10:05:10 dg-p network: [  OK  ]
Jul  4 10:05:11 dg-p network: Bringing up interface eno16777736:  Error: Connection activation failed: No suitable device found for this connection.
Jul  4 10:05:11 dg-p network: [FAILED]
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p network: RTNETLINK answers: File exists
Jul  4 10:05:11 dg-p systemd: : control process exited, code=exited status=1
Jul  4 10:05:11 dg-p systemd: Failed to start LSB: Bring up/down networking.
Jul  4 10:05:11 dg-p systemd: Unit entered failed state.
Jul  4 10:05:11 dg-p systemd: failed.

solve
Many Baidu said that it was a problem with MAC address or NetworkManager service, but it still has not been solved after trying it. The person who tied the bell must also try to change the network card name--
(1) Modify the network card name and configuration file
# mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0
Modify the name and device in the configuration file
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
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
NAME=eth0
UUID=d890d6e6-01f6-4063-bf70-cd4e1787d0a8
HWADDR=00:50:56:8b:57:82                                                    �
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.70.42
NETMASK=255.255.255.0
GATEWAY=192.168.70.254
(2) Modify /etc/sysconfig/grub, add =0 biosdevname=0
# vi  /etc/sysconfig/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto =centos/root =centos/swap =0 biosdevname=0 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
(3) Manual generation and other methods
Check the interface's MAC address
# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno16777728: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 00:0c:29:28:ac:54 brd ff:ff:ff:ff:ff:ff
Generate files
# vi /etc/udev//
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:28:ac:54", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"