Why Does My ECS Fail to Obtain an IP Address?
Symptom
The private IP address of the ECS fails to be obtained.
Troubleshooting
Locate the fault based on the following procedure.
Checking Whether DHCP Is Enabled
Check whether the DHCP function of the subnet is enabled (enabled by default).
Switch to the subnet details page. If DHCP is disabled, you must manually configure a static IP address for the ECS by referring to step 3.
Checking Whether the dhclient Process Exist
- Check whether the dhclient process exists:
ps -ef | grep dhclient
- If the dhclient process does not exist, log in to the ECS and restart the ECS NIC or send a DHCP request.
- If the DHCP client does not send requests for a long time, for example, the fault occurs again after the NIC restarts, you can use the following method to configure the static IP address.
- Linux:
- Run the following command to open the /etc/sysconfig/network-scripts/ifcfg-eth0 file:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
- Modify the following configuration items in the /etc/sysconfig/network-scripts/ifcfg-eth0 file.
BOOTPROTO=static
IPADDR=192.168.1.100 #IP address
NETMASK=255.255.255.0 #Subnet mask
GATEWAY=192.168.1.1 #Gateway address
- Run the following command to restart the network service:
- Run the following command to open the /etc/sysconfig/network-scripts/ifcfg-eth0 file:
- Windows:
On the Local Area Connection Status tab, click Properties. In the displayed area, select Internet Protocol Version 4 (TCP/IPv4) and click Properties. In the displayed area, enter the IP address, subnet mask, and the default gateway address.
- Linux:
Connectivity FAQs
- Does a VPN Allow Communication Between Two VPCs?
- Why Are Internet or Internal Domain Names in the Cloud Inaccessible Through Domain Names When My ECS Has Multiple NICs?
- What Are the Priorities of the Custom Route and EIP If Both Are Configured for an ECS to Enable the ECS to Access the Internet?
- Why Are There Intermittent Interruptions When a Local Host Accesses a Website Built on an ECS?
- Why Do ECSs Using Private IP Addresses in the Same Subnet Only Support One-Way Communication?
- Why Does Communication Fail Between Two ECSs in the Same VPC or Packet Loss Occur When They Communicate?
- Why Can't My ECS Use Cloud-init?
- Why Can't My ECS Access the Internet Even After an EIP Is Bound?
- Why Is My ECS Unable to Communicate at a Layer 2 or Layer 3 Network?
- How Do I Handle a BMS Network Failure?
- Why Does My ECS Fail to Obtain an IP Address?
- How Do I Handle a VPN or Direct Connect Connection Network Failure?
- Why Can My Server Be Accessed from the Internet But Cannot Access the Internet?
- Why Can't I Access Websites Using IPv6 Addresses After IPv4/IPv6 Dual Stack Is Configured?
- Why Does My ECS Fail to Communicate with Other After It Has Firewall Installed?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
more