Many friends in the use of centos7 system, sometimes need to assign multiple IP addresses, which involves modifying the network adapter configuration, but after modifying the network adapter configuration, restart network service will appear “Failed to start LSB: Bring up/down” network error, this should be how to solve the problem?

Run the systemctl status network.service command to check whether an error line can be found:

Email protected] ~]# 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 Mon 2019-03-14 23:24:37 CST; 16s ago

Solutions are as follows:

Method 1: Change the MAC address

The MAC address in the configuration file is inconsistent with that of the current NIC. You only need to modify the configuration file.

1. Run the IP addr show command to view the current MAC address

Failed to start LSB: Bring up/ Down

2. Modify the network link file starting with ifcfg in /etc/sysconfig/network-scripts

Such as vim/etc/sysconfig/network – scripts/ifcfg – eth1

Change HWADDR= “00:0c:29:7f:76:e8” to “00:0 C :29:5d:6f:01”

3. Systemctl restart network. Servic Restarts the network successfully.

The second method is to disable NetworkManager

1. Systemctl stop NetworkManager

2. Systemctl disable NetworkManager

After the restart, the network is normal

The third method is to modify the nic file name

After the OS is installed, nics are named by default, such as eno9 and ENO17. Wait, if you have changed the name of the network card before, for example, to eth0, you can change the configuration file as follows:

1. Modify the nic name and configuration file

mv /etc/sysconfig/network-scripts/ifcfg-enoeno9 /etc/sysconfig/network-scripts/ifcfg-eth0

Modify 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 NAME=eth0 UUID= d890d6e6-01f6-4063-BF70-cd4e1787d0a8 HWADDR=00:50:56:8b:57:82 # DEVICE=eth0 ONBOOT=yes IPADDR=IP

NETMASK= Mask GATEWAY= GATEWAY

Add net.ifnames=0 biosdevname=0 to /etc/sysconfig/grub

vi /etc/sysconfig/grub

5 GRUB_DISTRIBUTOR GRUB_TIMEOUT = = “(sed ‘s, the ∗ (sed’ s, *(sed ‘s,release.∗,,g’ /etc/system-release) “GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT crashkernel GRUB_CMDLINE_LINUX = “= =” console “auto rd., LVM. The lv = centos/root rd., LVM. The lv = centos/swap Net. ifnames=0 biosDevName =0 RHGB quiet “GRUB_DISABLE_RECOVERY=” true”

3. Manually generate 70-persistent-net.rules and other methods

View the MAC address of the interface

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 generated file

vi /etc/udev/rules.d/70-persistent-net.rules

SUBSYSTEM = = “net”, ACTION = = “add”, DRIVERS = = “?” , ATTR {address} = = “00:0 c: then: ac: 54”, ATTR {type} = = “1”, the KERNEL eth “= =”, eth0 NAME = “”

Finally, reboot the machine :# reboot and you’re almost done.