Elastic IP addresses (EIPs) are public IP addresses that you can separately purchase and own. After you associate an EIP with an Elastic Compute Service (ECS) instance, the instance can communicate with the Internet by using the EIP. Compared with static public IP addresses (also called auto-assigned or system-assigned public IP addresses), EIPs are more flexible and can be associated with resources of multiple cloud services, such as ECS instances, Server Load Balancer (SLB) instances, and NAT gateways. This topic describes how to convert a static public IP address to an EIP.
Differences between static public IP addresses and EIPs
Precautions
Item | Description |
Address convertibility | After a static public IP address is converted to an EIP, you cannot convert the EIP back to a static public IP address. If you require a static public IP address for your instance after the conversion, you can disassociate the EIP from the instance and adjust the public bandwidth for a new static public IP address to be assigned to your instance. For more information, see Modify the bandwidth configurations of subscription instances or Modify the bandwidth configurations of pay-as-you-go instances. Note Alternatively, you can call the ModifyInstanceNetworkSpec operation to modify the public bandwidth of your ECS instance and enable a new static public IP address to be assigned to the instance. |
IP address | The static public IP address is converted to and retained as an EIP. |
Billing | The billing method for network usage remains unchanged after the conversion. The EIP is separately billed. The billable items of the EIP are different from the billable items of the static public IP address. In specific scenarios, you are charged for EIP configuration and association. For more information about the billing of EIPs, see Pay-as-you-go. |
Prerequisites
Before you convert the static public IP address of an instance to an EIP, make sure that the following requirements are met:
The instance is created in a VPC and has a static public IP address.
If the instance is a pay-as-you-go instance, you have no overdue payments in your account.
If the instance is a subscription instance, the instance uses the pay-by-traffic billing method for network usage. If the subscription instance uses the pay-by-bandwidth billing method for network usage, the billing method for network usage is changed to pay-by-traffic. For more information, see Change from pay-by-bandwidth to pay-by-traffic.
If the instance is a subscription instance, it has at least 24 hours remaining in its subscription duration.
If the instance resides in the China (Hong Kong) region, the instance does not use BGP (Multi-ISP) Pro lines. You cannot convert the static public IP address of an instance that uses BGP (Multi-ISP) Pro lines in the China (Hong Kong) region to an EIP.
If an instance type change is made for the instance, wait until the new instance type takes effect before you convert the static public IP address.
The instance is in the Running or Stopped state.
Procedure
You can also call the ConvertNatPublicIpToEip operation to convert the static public IP address of an instance in a VPC to an EIP. To call this operation, use SDKs 4.3.0 or later. For more information, see Install and use ECS SDKs.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Find the ECS instance whose network type is VPC and whose IP address you want to convert. In the Actions column, choose
.In the dialog box that appears, confirm the information and click OK.
Refresh the instance list.
After the public IP address is converted to an EIP, the public IP address is marked by (EIP).
You can click the EIP to go to the Elastic IP Addresses page in the VPC console to manage the EIP.
What to do next
After the static public IP address is converted to an EIP, you can perform the following operations:
Disassociate the EIP from the ECS instance and associate the EIP to an SLB instance or a different ECS instance. For more information, see EIPs.
Use EIP bandwidth plans to save costs. For more information, see Reduce the costs of data transfer over the Internet.
Release the EIP to stop EIP billing. EIPs are billed until they are released. If you no longer require an EIP, we recommend that you release it. For more information, see Release a pay-as-you-go EIP.