Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Elastic Cloud Server/ Troubleshooting/ Configuring the Network/ Why Is the ECS IP Address Lost After the System Time Changes?

Why Is the ECS IP Address Lost After the System Time Changes?

Updated on 2024-08-15 GMT+08:00

Symptom

After the system time changes, an exclamation mark (!) is displayed for the NIC, and the ECS cannot connect to the Internet.

Scenarios

  • The operations described in this section apply to ECSs running CentOS 7 or EulerOS that use DHCP to obtain IP addresses.
  • The default DHCP lease time is 24 hours. Specific scenarios may be different.

Possible Cause

DHCP session process

A typical DHCP session includes DHCP discover, DHCP offer, DHCP request, and DHCP acknowledgment, as shown in Figure 1.

Figure 1 DHCP session
  • DHCP Discover

    The DHCP client sends a broadcast message on the physical subnet to search for available DHCP servers. The network administrator can configure a local route to forward DHCP packets to DHCP servers on another subnet. The client generates a UDP packet whose destination address is 255.255.255.255 or the specific subnet broadcast address.

  • DHCP Offer

    When a DHCP server receives an IP address lease request from the client, the DHCP server provides an IP address lease and reserves an IP address for the client, and then sends a DHCPOFFER message to the client through unicast. This message contains the MAC address of the client, the IP address that the server is providing, the subnet mask, the lease duration, and the IP address of the DHCP server making the offer.

  • DHCP Request

    In response to the DHCP offer, the client replies with a DHCPREQUEST message that contains the IP address of the server making the offer, which is a broadcast informing the server that it accepts the offer. When other DHCP servers receive this message, they withdraw any offers they have made to the client and return the offered IP addresses to the pool of available addresses. A client can receive DHPC offers from multiple servers, but it will accept only one DHCP offer.

  • DHCP Acknowledge (DHCP ACK)

    When the DHCP server receives the DHCPREQUEST message from the client, the configuration process enters its final phase. The acknowledgement phase involves sending a DHCPACK packet to the client. This packet contains the lease duration and any other configuration information that may be requested by the client. At this point, the TCP/IP address configuration is complete.

Fault Locating

  1. View the DHCP request records of the client.
    grep -E "dhclient|DHCP" /var/log/messages
    Figure 2 DHCP request records
    • The records show that dhclient renewed the IP address on May 12. Since the system was manually changed, the actual time was April 26.
    • The next renewal occurred 33,696 seconds (about 9 hours and 21 minutes) later, usually when half of the lease time has passed. That is, the next renewal occurred at around 21:21 on May 12.
      NOTICE:

      You can also query the dhclient renewal information file for each successful renewal. Run the following command to query the path that saves the file. The file name is ended with .lease.

      ps -ef |grep dhclient

  2. Run the following command to check the system logs. The logs show that the system time was changed 5 hours and 14 minutes later after the renewal, and changed to April 26. This means the next renewal request would be sent in 16 days, but not 9 hours it should be. dhclient failed to renew the lease and just silently let the lease expire. After the lease expired, the IP address was withdrawn by the DHCP server. As a result, the IP address was lost.
    grep "Time has been changed" /var/log/messages
    Figure 3 System logs

Solution

  1. Run dhclient manually to obtain the private IP address.

    dhclient -r eth0

    ifconfig eth0 down

    ifconfig eth0 up

    dhclient eth0

  2. Restart the ECS. The system time will restore and the system will obtain the IP address again.
  3. Enable time synchronization with an NTP server. For details, see Does Huawei Cloud Provide the NTP Server and How Can I Configure It?

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback