If an Elastic Compute Service (ECS) instance in the classic network or a virtual private cloud (VPC) is assigned a public IP address, you can change the IP address within 6 hours after the instance is created. This topic describes how to change the public IP address of an instance in the ECS console.
Prerequisites
The ECS instance whose public IP address you want to change meets the following requirements:
The instance is in the Stopped (
Stopped
) state.NoteIf the billing method of an instance is pay-as-you-go and the network type of the instance is VPC, you must enable the standard mode for the instance when you stop the instance. If you enable the economical mode for the instance, the Change Public IP Address option is not displayed in the ECS console.
The instance is assigned a public IP address.
The instance is less than 6 hours old.
If the instance does not meet one of the preceding requirements, the Change Public IP Address option is not displayed in the ECS console.
Background information
The following limits apply when you change the public IP address of an ECS instance:
You can change the public IP address of an instance up to three times within 6 hours after the instance is created.
NoteAfter 6 hours of instance creation, you can convert the public IP addresses of instances in VPCs (excluding subscription instances that use the pay-by-bandwidth billing method for network usage) to elastic IP addresses (EIPs) and then change the IP addresses. EIPs are static public IP addresses that you can separately purchase and associate with or disassociate from ECS instances. For more information, see Convert the public IP address of an instance in a VPC to an EIP.
The operations that are described in this topic do not apply to an instance that is not assigned a public IP address. You can use one of the following methods to assign a public IP address to an ECS instance that does not have a public IP address:
Apply for an EIP and associate the EIP with the instance. For more information, see Apply for an EIP in EIP documentation.
Modify the public bandwidth of the instance to allocate an auto-assigned public IP address to the instance. For information about how to modify the public bandwidth of subscription instances, see Overview of instance configuration changes. For information about how to modify the public bandwidth of pay-as-you-go instances, see Modify the bandwidth of a pay-as-you-go instance.
Procedure
Log on to the ECS console.
In the left-side navigation pane, choose .
In the upper-left corner of the top navigation bar, select a region.
Find the instance whose public IP address you want to change and choose
in the Actions column.In the Change Public IP Address message, confirm the information and click Confirm.
If the public IP address of the instance is changed, a new public IP address is displayed in the preceding message.