EIP

更新时间:
复制 MD 格式

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

  1. In the EIP console, click Create EIP.

  2. 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.

  3. 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

  1. In the EIP console, select the region and click Apply for Specific EIP.

  2. Set Request Type to Apply for Specific EIP. Configure the parameters and click OK.

    1. 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.

    2. 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.

      BGP (Multi-ISP) Pro supported regions

      • Pay-as-you-go: China (Hong Kong), Japan (Tokyo), Singapore, Malaysia (Kuala Lumpur), Philippines (Manila), Indonesia (Jakarta), Thailand (Bangkok)

      • Subscription: China (Hong Kong)

    3. 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.

Important

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.

How to request a contiguous EIP group

Console

  1. In the EIP console, select the target region and click Apply for Specific EIP.

  2. Set Request Type to Request Contiguous EIP Group. Configure the parameters and click OK.

    1. Mask for Contiguous EIP Group: This determines the number of allocatable EIPs. Due to system-reserved addresses, a requested contiguous EIP group may have one, three, or four fewer allocatable IPs.

    2. Metering Method: Choose between pay-by-bandwidth and pay-by-data-transfer. If your EIP service has been upgraded to pay-by-CDT, data transfer fees for EIPs in the requested contiguous EIP group will be billed through CDT.

API

Call AllocateEipSegmentAddress to request a contiguous EIP group.

How to migrate a contiguous EIP group to an IP address pool

Migrate the entire CIDR block of the contiguous EIP group into an IP address pool. Before you begin:

Console

  1. In the EIP console, select the target region in the top navigation bar. Find any EIP in the target contiguous EIP group. In the Actions column, choose More > Migrate to IP Address Pool.

  2. Review the information in the message, then click OK.

  3. After the migration is successful, the IP Address Pool ID column for the EIPs will display the ID of the new IP address pool.

    Migration confirmation

API

Call TransformEipSegmentToPublicIpAddressPool to migrate a contiguous EIP group to an IP address pool.

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

  1. Go to ECS console - Instances.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Find the ECS instance you want to associate an EIP with. In the All Operations column, choose Network and Security Group > Associate with EIP.

  4. 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.

  5. 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.

Important

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.

  1. Go to ECS console - Instances.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Find the ECS instance from which you want to disassociate an EIP. In the All Operations column, choose Network and Security Group > Disassociate EIP.

  4. In the Disassociate EIP dialog box, confirm the information in the message.

  5. Click OK.

    Note

    After the EIP is successfully disassociated, it no longer appears in the IP Address column on the ECS instances page.

  6. (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

  1. (Optional) Create a new EIP. For more information, see Create an EIP.

  2. Disassociate the EIP that is currently associated with the ECS instance. For more information, see Disassociate an EIP.

    Important
    • After 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.

    • If you no longer need a subscription EIP after disassociating it, you can cancel its subscription. For more information, see Unsubscription rules.

  3. Associate the new EIP with the ECS instance. For more information, see Associate an EIP.

FAQ

  1. 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?

  2. 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.

  3. 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.