Why Does My ECS Running CentOS 7 Fail to Obtain an IP Address Using dhclient?
Symptom
After an ECS was started, it failed to obtain an IP address because dhclient did not run.
Possible Causes
The possible causes are as follows:
- NetworkManager is not configured to start at boot.
- The target NIC is not managed by NetworkManager.
Constraints
The operations described in this section apply to ECSs running CentOS 7 series, EulerOS 2 series, or Ubuntu 18.04.
Solution
- Run the following command to check whether dhclient is running:
- If dhclient is not detected, run the following command to check whether NetworkManager is running:
# systemctl status NetworkManager
- If NetworkManager is in Active: inactive (dead) state, NetworkManager is not enabled. Run the following command to check whether NetworkManager is automatically started upon system startup:
# systemctl is-enabled NetworkManager
If the command output is disabled, run the following command to make NetworkManager start at boot automatically:
# systemctl enable NetworkManager && systemctl start NetworkManager
- If NetworkManager is in Active: active (running) state, run the following command to check whether the target NIC is managed by NetworkManager:
# nmcli device status
If the NIC is in unmanaged state, run the following command to make NetworkManager manage the NIC:
# nmcli device set eth0 managed yes
- If NetworkManager is in Active: inactive (dead) state, NetworkManager is not enabled. Run the following command to check whether NetworkManager is automatically started upon system startup:
- Restart NetworkManager.
- Run the following command to check whether the private IP address can be allocated:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.