Linux network 重启报错:Failed to start LSB: Bring up/dow…
1. 错误信息如下:
[root@localhost network-scripts]# service network start
Starting 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.
[FAILED]
[root@localhost network-scripts]# systemctl status network.service
主要错误信息为:Failed to start LSB: Bring up/dow…
● 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 Fri 2023-07-28 22:14:24 PDT; 18s ago
Docs: man:systemd-sysv-generator(8)
Process: 3042 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
Process: 3130 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
Jul 28 22:14:24 localhost.localdomain network[3130]: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost.localdomain network[3130]: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost.localdomain network[3130]: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost.localdomain network[3130]: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost.localdomain network[3130]: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost.localdomain network[3130]: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost.localdomain systemd[1]: network.service: control process ...1
Jul 28 22:14:24 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/dow....
Jul 28 22:14:24 localhost.localdomain systemd[1]: Unit network.service entered fail....
Jul 28 22:14:24 localhost.localdomain systemd[1]: network.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
2. 原因
Error: Connection activation failed: No suitable device found for this connection (device ens33 not available because profile is not compatible with device (mismatching interface name)).
由上述描述可知:修改了网卡的名称导致配置文件中的网卡名称和实际网卡名称不一致,日志(/var/log/messages)如下:
ul 28 22:14:23 localhost network: [FAILED]
Jul 28 22:14:23 localhost systemd: Stopped LSB: Bring up/down networking.
Jul 28 22:14:23 localhost systemd: Starting LSB: Bring up/down networking...
Jul 28 22:14:23 localhost NetworkManager[640]: <info> [1690607663.9719] ifcfg-rh: update /etc/sysconfig/network-scripts/ifcfg-ens33 (66b3302a-52f8-4eef-b818-29cd64e4511c,"ens33")
Jul 28 22:14:24 localhost network: Bringing up loopback interface: ERROR : [/etc/sysconfig/network-scripts/ifup-eth] Device lo has different MAC address than expected, ignoring.
Jul 28 22:14:24 localhost /etc/sysconfig/network-scripts/ifup-eth: Device lo has different MAC address than expected, ignoring.
Jul 28 22:14:24 localhost network: [FAILED]
Jul 28 22:14:24 localhost network: Bringing up interface ens33: Error: Connection activation failed: No suitable device found for this connection (device ens33 not available because profile is not compatible with device (mismatching interface name)).
Jul 28 22:14:24 localhost network: [FAILED]
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost network: RTNETLINK answers: File exists
Jul 28 22:14:24 localhost systemd: network.service: control process exited, code=exited status=1
Jul 28 22:14:24 localhost systemd: Failed to start LSB: Bring up/down networking.
Jul 28 22:14:24 localhost systemd: Unit network.service entered failed state.
Jul 28 22:14:24 localhost systemd: network.service failed.
3. 查看配置 vi /etc/sysconfig/network-scripts/ifcfg-ens33 修改DEVICE值为nes33 重启即可
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="66b3302a-52f8-4eef-b818-29cd64e4511c"
DEVICE="ens3"
ONBOOT="yes"
IPADDR=192.168.84.140
[root@localhost network-scripts]# service network restart
Restarting network (via systemctl): [ OK ]
[root@localhost network-scripts]#