An elastic IP address (EIP) is a public IP address resource that you can purchase and hold independently. An EIP is a NAT IP address on an Alibaba Cloud public gateway that maps to an associated cloud resource through NAT. After you associate an EIP with a cloud resource, the resource can use the EIP to communicate with the internet. Compared with a fixed public IP address, an EIP offers greater flexibility. This topic describes how to create an EIP, and how to associate an EIP with and disassociate an EIP from an ECS instance in a VPC.
Create an EIP
Console
In the EIP console, click Create EIP.
Configure the following:
Billing Method: Pay-as-you-go for fluctuating workloads, Subscription for long-term stable use.
Region: Must match the region of the cloud resource you plan to associate the EIP with.
Line Type: Choose between BGP (Multi-ISP) and BGP (Multi-ISP) Pro. Can't be changed after creation.
Security Protection: Select Anti-DDoS (Enhanced) if you need terabit-level DDoS protection. Only available for pay-as-you-go BGP (Multi-ISP) EIPs. Can't be changed after creation.
IP Address Pool: Optionally allocate from an existing pool.
Bandwidth: Set the peak bandwidth in Mbps.
Complete the payment.
After creation, associate the EIP with a cloud resource to start using it.
If you're using the pay-by-data-transfer metering method, select Pay-by-CDT as the billing method. CDT offers tiered pricing and a free tier that can reduce your data transfer costs.
API
Call AllocateEipAddress.
Recover a released EIP
You can recover an EIP or static public IP address (from an ECS or CLB instance) that was released within the past 7 days. The recovered address becomes a pay-as-you-go, pay-by-data-transfer EIP with 5 Mbps default bandwidth. If your EIP service has been upgraded to pay-by-CDT, the data transfer fees for the recovered public IP address will be billed through CDT.
Recovery fails if the address has been reassigned to another account, locked for security, or reclaimed by the system.
Console
In the EIP console, select the region and click Apply for Specific EIP.
Set Request Type to Apply for Specific EIP. Configure the parameters and click OK.
To Request by IP Address, enter the public IP address you previously owned. To Request by EIP ID, find the ID in your historical orders and enter the ID.
If the released EIP was a BGP (Multi-ISP) Pro EIP, set Line Type to BGP (Multi-ISP) Pro. Note that BGP (Multi-ISP) Pro EIPs are supported only in specific regions.
If you have enabled IP address pools, you can specify an IP address pool and request a specific EIP from it.
API
Call AllocateEipAddressPro.
Request a contiguous EIP block
You can request a contiguous block of EIPs in the following ways:
Use IP address pools: This feature is disabled by default. To use it, contact your business manager.
Contiguous EIP group: Contiguous EIP groups work like individual EIPs — you can associate them with cloud resources for internet access, and they incur the same charges. However, there are some differences:
EIPs in a contiguous EIP group are pay-as-you-go and cannot be converted to subscription.
You cannot release individual EIPs from a contiguous EIP group. You can only release all EIPs in the group at a time.
As of August 6, 2024, this feature is available only to accounts that have used it previously. If you have not used this feature before, use IP address pools instead. Migrate to IP address pools for more flexibility and better management.
Associate an EIP
Prerequisites
To associate an EIP with an ECS instance, make sure that the ECS instance meets the following requirements:
The instance must be in a VPC.
The instance must be in the same region as the EIP.
The instance must be in the Running or Stopped state.
The instance's primary network interface must not have an associated public IP address.
Procedure
Associate a single EIP
Go to ECS console - Instances.
In the upper-left corner of the page, select a region and resource group.
Find the ECS instance you want to associate an EIP with. In the All Operations column, choose .
In the Associate EIP dialog box, select the EIP that you want to associate.
If no EIPs are available, perform one of the following operations:
Make sure that you have created an EIP. If not, click Create EIP on the right side of the selection box. For more information, see Create an EIP.
Make sure that the EIP is not associated with another cloud resource. If it is, you must first disassociate the EIP from the other resource. For more information, see Disassociate an EIP from a cloud resource.
Click OK.
After the association is successful, you can view the instance's EIP on the ECS instances page.
Associate multiple EIPs
To host multiple applications on an ECS instance, each with a separate public IP address, you can associate multiple EIPs with a secondary elastic network interface on the instance. For more information, see Associate multiple EIPs with an ECS instance in standard mode.
Disassociate an EIP
If you no longer need to access an ECS instance over the internet or need to change the EIP, we recommend that you disassociate the EIP to avoid unnecessary costs.
Disassociating an EIP removes internet access to the instance. Before you proceed, ensure that public access is no longer needed or that an alternative network connection is in place.
Go to ECS console - Instances.
In the upper-left corner of the page, select a region and resource group.
Find the ECS instance from which you want to disassociate an EIP. In the All Operations column, choose .
In the Disassociate EIP dialog box, confirm the information in the message.
Click OK.
NoteAfter the EIP is successfully disassociated, it no longer appears in the IP Address column on the ECS instances page.
(Optional) You are still charged for a disassociated EIP. If you no longer need the EIP, release it. For more information, see Release a pay-as-you-go EIP.
Change an EIP
To change an instance's EIP, first disassociate the current EIP and then associate a new one.
Prerequisites
The ECS instance must be in a VPC.
The ECS instance must be in the Running or Stopped state.
The ECS instance must be in the same region as the EIP that you want to associate.
The ECS instance must not have a fixed public IP or any other associated EIPs.
Procedure
(Optional) Create a new EIP. For more information, see Create an EIP.
Disassociate the EIP that is currently associated with the ECS instance. For more information, see Disassociate an EIP.
ImportantAfter you disassociate a pay-as-you-go EIP, you are still charged a configuration fee for the EIP. If you no longer need the EIP, release it.
For more information about EIP configuration fees, see Pay-as-you-go.
To release a pay-as-you-go EIP, see Release a pay-as-you-go EIP.
If you no longer need a subscription EIP after disassociating it, you can cancel its subscription. For more information, see Unsubscription rules.
Associate the new EIP with the ECS instance. For more information, see Associate an EIP.
FAQ
Can I resolve high latency when accessing an ECS instance in a region outside the Chinese mainland from within the Chinese mainland by changing the public IP address?
No.
When you access an ECS instance in a region outside the Chinese mainland from within the Chinese mainland, the traffic passes through international carrier routing nodes. This traffic can be affected by international link congestion and carrier egress routing restrictions, leading to unstable network links, packet loss, or other issues. As a result, clients in some areas may not be able to access certain instances.
If your users are primarily located in the Chinese mainland, we recommend using server sites within the Chinese mainland to avoid public network routing restrictions.
To allow users in the Chinese mainland to access ECS instances in other regions, we recommend using Global Accelerator. For more information, see What is Global Accelerator?
Can I associate an EIP with an ECS instance from another Alibaba Cloud account, or transfer an EIP to another account?
Yes.
For more information, see Transfer an EIP across accounts.
Can I specify a particular IP address when purchasing an EIP?
No.
When you purchase an EIP, the system randomly assigns an IP address. You cannot specify a particular IP address.
References
After you associate an EIP, you can also refer to the following documents to learn about EIP billing, bandwidth usage, and traffic consumption.
After you disassociate an EIP, the instance loses its public IP address. You may need to perform the following operations to ensure that your applications or services continue to run properly.
> Migrate to IP Address Pool.