Problem description
When you run the systemctl restart network command in Linux to start the network service, the error Job for network.service failed because the control process exited with error code. is returned, as shown in the following figure. This topic uses a CentOS 7.9 system as an example.
Troubleshooting
If this issue occurs, run the sudo journalctl -xe -u network.service command to view the detailed cause.

Possible causes
This issue can be caused by network configuration errors that prevent Elastic Network Interfaces (ENIs) from loading correctly. These errors often occur after you modify the network configuration. Common scenarios include the following:
A secondary ENI was detached from the instance in the console or using OpenAPI, but the configuration file for the corresponding ENI was not deleted.
The ENI name in the configuration file does not match the actual name. For example, you run the
ip acommand and the output shows that the actual ENIs are eth0 and eth1, but they are named eth0 and eth2 in the network configuration file (/etc/sysconfig/network-scripts/ifcfg-*).
Solution
Follow these steps to align your network configuration with the actual setup. This includes deleting configuration files for ENIs that do not exist and ensuring that ENIs are named correctly.
Connect to the ECS instance remotely.
For more information, see Overview of connection methods.
Check whether the ENI configuration files match the ENIs of the ECS instance.
View the ENI configuration files.
ll /etc/sysconfig/network-scripts/ifcfg*NoteThe directory for ENI configuration files varies by operating system. Modify the preceding command as needed.
Red Hat series: /etc/sysconfig/network-scripts/
CentOS 6/7/8
Red Hat 6/7/8/9
Anolis 7/8
Fedora 33/34/35
Alibaba Cloud Linux 2/3
CentOS Stream 8/9
Rocky Linux
AlmaLinux
Ubuntu 18/20: /etc/netplan/
SLES series: /etc/sysconfig/network/
OpenSUSE
SUSE Linux
Debian and Ubuntu 16.04 or earlier: Hot-plugging is supported for ENIs. Therefore, a non-existent ENI does not affect network service startup.
The following figure shows that configuration files exist for two ENIs: eth0 and eth1.

View the ENI information of the ECS instance.
ip address showThe following figure shows that the ECS instance has only one ENI: eth0.

If the configuration files do not match the actual ENIs, proceed to step 3.
If the ENI names in the configuration files do not match the actual ENI names, modify the file names (ifcfg-eth*) and the
DEVICEvalues within the files to ensure that they are consistent. Then, proceed to step 4.If the configuration files and the actual ENIs are consistent, no further action is required.
Delete the extra ENI configuration file.
rm -rf /etc/sysconfig/network-scripts/ifcfg-eth1The following figure shows that the configuration file for the eth1 ENI has been deleted.

Restart the network service.
systemctl restart networkCheck the status of the network service.
systemctl status networkThe following figure shows that the status of the network service is Normal.
