Why Can't I Use DHCP to Obtain a Private IP Address?
Symptom
You attempt to use DHCP to obtain a private IP address, but you cannot obtain the IP address.
- For Linux, a private IP address cannot be assigned.
- For Windows, a private IP address is changed to an IP address in the 169.254 network segment, which is different from the private IP address displayed on the ECS console.
Solution
- Check whether dhclient is running in the ECS.
- Log in to the ECS and run the following command:
ps -ef | grep dhclient
- If the process is not running, log in to the ECS, and restart the ECS NIC or initiate a DHCP request.
- Log in to the ECS and run the following command:
- Handle the issue if the DHCP client fails to work for a long time (for example, the issue recurs after the NIC is restarted).
- Configure a static IP address.
- Windows
- Right-click Local Area Connection and choose Properties from the shortcut menu.
- In the displayed dialog box, select Internet Protocol Version 4 (TCP/IPv4), click Properties, and modify parameter settings.
- Linux
- Log in to the ECS and run the following command to modify parameter settings:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static IPADDR=192.168.1.100 #IP address (modified) NETMASK=255.255.255.0 #Mask (modified) GATEWAY=192.168.1.1 #Gateway IP address (modified)
- Restart the ECS to make the network settings take effect.
- Log in to the ECS and run the following command to modify parameter settings:
- Windows
- Select an image in which DHCP runs stably.
Use the public images, which support DHCP, provided on the management console.
DHCP needs to be configured only when Network is used for network management. DHCP does not need to be configured when NetworkManager is used for network management.
- Configure a static IP address.
- If the fault persists, obtain the messages in /var/log/messages on the affected ECS, use the MAC address of the affected NIC to filter the desired log, and check whether there is any process that prevents DHCP from obtaining an IP address.
- If the fault persists, contact customer service for technical support.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot