All Products
Search
Document Center

:What do I do if the IP address of a Linux ECS instance cannot be renewed when the network process for IP address renewal is abnormal or does not exist?

Last Updated:Jul 30, 2024

This topic describes how to resolve the issue that the IP address of a Linux Elastic Compute Service (ECS) instance cannot be renewed when the network process for IP address renewal is abnormal or does not exist.

Problem description

If Dynamic Host Configuration Protocol (DHCP) is configured on a Linux ECS instance and the network process for IP address renewal, such as dhclient, is not started or does not exist, the IP address of the instance cannot be renewed when the IP lease expires. The issue interrupts network connections. To restore network connections, you must resolve the issue and make sure that the network configurations are correct.

Solution

Step 1: Check the status of the network process

Run the ps -ef |grep [$Network process] command to check whether the network process exists. If the network process does not exist, potential risks exist. The following table describes the network processes that correspond to different operating system (OS) distributions for IP address renewal when DHCP is configured.

OS distribution

Network process

  • CentOS 6 and CentOS 7

  • Debian 8, Debian 9, and Debian 10

  • Ubuntu 14 and Ubuntu 16

/sbin/dhclient

CentOS 8

/usr/sbin/NetworkManager

  • Ubuntu 18 and Ubuntu 20

  • Alibaba Cloud Linux 2

/lib/systemd/systemd-networkd

  • SUSE Linux Enterprise Server (SLES) 12 and SLES 15

  • openSUSE 15

/usr/lib/wicked/bin/wickedd-dhcp4 

Step 2: Restart the network service associated with the network process

Restart the network service associated with the network process to handle service exceptions or resolve the issue that the network process does not exist. The network service name varies based on the Linux distribution and version. The following table describes the network service names that correspond to different Linux distributions and versions and the commands that can be used to start the network services.

Important

The restart operation may interrupt network connections for a short period of time and may interrupt services that are running on the instance. We recommend that you restart the network service during off-peak hours.

OS

Version

Network service name

Command

CentOS

6

network

service network restart

7

network

systemctl restart network

8

NetworkManager

systemctl restart NetworkManager

Debian

8

networking

systemctl restart networking

9

networking

systemctl restart networking

10

networking

systemctl restart networking

Ubuntu

14

networking

service networking restart

16

networking

systemctl restart networking

18

systemd-networkd

systemctl restart systemd-networkd

20

systemd-networkd

systemctl restart systemd-networkd

SLES

15

wicked

systemctl restart wicked

12

wicked

systemctl restart wicked

openSUSE

15

wicked

systemctl restart wicked

Alibaba Cloud Linux 2

2

systemd-networkd

systemctl restart systemd-networkd