How Do I Fix a Network Startup Failure Due to Multiple NIC Configuration Files?
Symptom
Error message "Device eth1 does not seem to be present" or "No suitable device found for this connection" is displayed after the network is started or restarted.
Scenarios
The following procedures apply to ECSs running CentOS, RHEL, or EulerOS.
Constraints
The solution described in this section involves restarting the NICs, which will temporarily interrupt the network connection.
Root Cause
When the network service is started, the system reads the NIC configuration file in the /etc/sysconfig/network-scripts/ directory. If there are multiple NIC configuration files, the network service fails to be started because the corresponding NIC cannot be found.
Solution
Back up unnecessary NIC configuration files and delete them from /etc/sysconfig/network-scripts/. The following uses an ECS with 11 NIC configuration files as an example.
- Run the following command to access the directory where the NIC configuration files reside:
- Run the following commands to back up the configuration files:
cp ifcfg-* tmp/
ls tmp/
Figure 2 Viewing NIC configuration files
- If only one NIC is needed, delete unnecessary NIC configuration files and file ifcfg-ens5 if it exists.
Run the following command to delete files from ifcfg-eth1 to ifcfg-eth11 and ifcfg-ens5.
rm -rf ifcfg-eth[1-9] ifcfg-eth10 ifcfg-eth11 ifcfg-ens5
Figure 3 Deleting unnecessary configuration files
- Stop unnecessary dhclient processes.
- Run the following command to restart the network service:
- Check the status of the network service.
Figure 5 Checking the network status
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.