An elastic IP address (EIP) is a public IP address that you can purchase and use as an independent resource. EIPs can be retained independently and associated with or disassociated from Elastic Compute Service (ECS) instances in virtual private clouds (VPCs).
Overview
EIPs are NAT IP addresses that are located in the public gateway of Alibaba Cloud. By means of NAT, EIPs are mapped to the primary elastic network interfaces (ENIs) of the ECS instances that are associated with the EIPs. You can associate EIPs with ECS instances that are located in VPCs to enable the instances to communicate over the Internet. Similar to system-assigned public IP addresses (PublicIP addresses), EIPs remain invisible inside the operating systems of ECS instances.
Differences between EIPs and public IP addresses
ECS instances located in VPCs support both public IP addresses and EIPs. The following table describes the differences between EIPs and public IP addresses in several aspects.
Item | PublicIP address | EIP |
---|---|---|
Scenario | If you want an instance to have a public IP address that will not be retained when the instance is released, you can configure a PublicIP address to be automatically assigned when you create the instance. | If you want to retain a public IP address after its associated instance is released for use with other ECS instances, use an EIP. Each EIP can be associated with or disassociated from different ECS instances. After an instance is released, its associated EIP is retained. |
Description | If you select Assign Public IPv4 Address when you create an ECS instance, a PublicIP address is assigned to the instance. | After an EIP is created, it can be associated with an ECS instance that is not assigned a PublicIP address. For more information, see Apply for an EIP and Associate an EIP with an instance. |
Maximum number of IP addresses that can be assigned to or associated with a single ECS instance | Only a single PublicIP address can be assigned to each ECS instance. | Multiple EIPs can be associated with a single ECS instance in multi-EIP-to-ENI mode. For more information, see Associate EIPs with secondary ENIs in multi-EIP-to-ENI mode (new applications are not accepted). |
Method to disassociate an IP address | After a PublicIP address is assigned to an ECS instance, the address can only be released along with the instance but cannot be disassociated from the instance. You can convert PublicIP addresses into EIPs as needed. EIPs can be associated with or disassociated from ECS instances at any time. For more information, see Convert the public IP address of a VPC-type instance to an EIP. | EIPs can be disassociated from ECS instances. For more information, see Disassociate an EIP from an instance. |
Method to release an IP address |
|
For more information, see Release a pay-as-you-go EIP. |
Method to view a media access control (MAC) address | ECS instances in VPCs are connected to the Internet by using the mapping of public IP addresses to internal network interface controllers (NICs). Therefore, the public NICs of ECS instances in VPCs cannot be discovered from within the instances regardless of whether the instances are assigned PublicIP addresses or associated with EIPs. |
Billing methods
EIPs support the subscription and pay-as-you-go billing methods. For more information, see Overview.
Limits
EIPs can be associated with ECS instances or ENIs. An EIP can be associated only with an ECS instance that meets the following requirements:
- The ECS instance is located in a VPC.
- The ECS instance is located in the same region as the EIP.
- The ECS instance is in the Running or Stopped state.
- No public IP addresses are associated with the primary ENI of the ECS instance.
Operations
- Create an EIP
You can go to the Elastic IP Addresses page in the VPC console to create an EIP and associate the EIP with an ECS instance that is located in a VPC and is not assigned public IP addresses. For more information, see Apply for an EIP.Note In multi-EIP-to-ENI mode, multiple EIPs can be associated with a single ECS instance. For more information, see Associate EIPs with secondary ENIs in multi-EIP-to-ENI mode (new applications are not accepted).
- Associate an EIP with an ECS instance
- You can log on to the ECS console and associate an EIP with an ECS instance that is located in a VPC and is not assigned public IP addresses. For more information, see Associate an EIP with an instance.
- You can also go to the Elastic IP Addresses page in the VPC console and associate an EIP with an ECS instance that is located in a VPC and is not assigned public IP addresses. For more information, see Associate an EIP with an ECS instance.
- Associate an EIP with a secondary ENI
You can go to the Elastic IP Addresses page in the VPC console and associate an EIP with a secondary ENI. Each ENI is automatically assigned a private IP address. After you associate an EIP with an ENI, the ENI has both a private IP address and a public IP address. For more information, see Overview.
- Disassociate an EIP from an ECS instance
- If your ECS instance no longer needs an EIP, you can disassociate the EIP from the instance in the ECS console. For more information, see Disassociate an EIP from an instance.
- You can also disassociate the EIP from the ECS instance on the Elastic IP Addresses page in the VPC console. For more information, see Disassociate an EIP from a cloud resource.
- Release an EIP
Billing of an EIP continues after it is disassociated. If you no longer need the EIP, go to the Elastic IP Addresses page in the VPC console to release the EIP. For more information, see Release a pay-as-you-go EIP.
For more information, see EIP overview.