Help Center > > FAQs> Connectivity> Why Does My ECS Fail to Obtain an IP Address?

Why Does My ECS Fail to Obtain an IP Address?

Updated at: Mar 04, 2021 GMT+08:00

Symptom

The private IP address of the ECS fails to be obtained.

Troubleshooting

Locate the fault based on the following procedure.

Figure 1 Troubleshooting process
  1. Checking Whether DHCP Is Enabled
  2. Checking Whether the dhclient Process Exist
  3. Checking ECS Logs

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

  1. Run the following command to check whether the dhclient process exists:

    ps -ef | grep dhclient

  2. If the dhclient process does not exist, log in to the ECS and restart the ECS NIC or send a DHCP request.
    • Linux OS:

      Run the dhclient ethx command. If dhclient commands are supported, run the ifdown ethx;ifup ethx command. In the command, ethx indicates the ECS NIC, for example, eth0 and eth1.

    • Windows OS:

      Disconnect the network connection and connect it.

  3. 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 OS:
      1. Run the following command to open the /etc/sysconfig/network-scripts/ifcfg-eth0 file:

        vi /etc/sysconfig/network-scripts/ifcfg-eth0

      2. 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

      3. Run the following command to restart the network service:

        service network restart

    • Windows OS:

      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.

Checking ECS Logs

Check the ECS messages log in the /var/log/messages directory.

Search for the NIC MAC address and check whether any processes that cause failures in obtaining IP addresses over DHCP exist.

Submitting a Service Ticket

If the problem persists, submit a service ticket.

Provide the customer service with the ECS ID, the ID of the subnet used by the ECS, and the ID of the VPC used by the ECS.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel