Manage EIPs for ECS instances

Updated at:

Create, recover, associate, and disassociate elastic IP address (EIP) resources for ECS instances in a VPC.

Create an EIP

Console

  1. In the EIP console, click Create EIP.

  2. Configure the EIP parameters and complete the purchase.

    1. Billing Method: The pay-as-you-go billing method is suitable for workloads with variable traffic. The subscription billing method is suitable for long-term, stable workloads. For more information, see Billing method.

      If you select the pay-as-you-go billing method, select a metering method for data transfer:

      1. When you set the Metering method to Pay-By-Data-Transfer: select Pay-by-CDT. CDT can help you reduce public data transfer costs. Retain the default bandwidth value, which can be adjusted at any time. The peak bandwidth of a pay-by-data-transfer EIP is a reference value and upper limit. It is not a guaranteed performance metric.

      2. When you set the Metering method to Pay-By-Bandwidth: You are charged for bandwidth usage. Set the peak bandwidth based on your business requirements.

    2. Region and zone: Select the same region as your cloud resources. An EIP is a region-level resource.

    3. Line Type: This parameter is available only in some regions. For guidance, see Line type. The Local ISP line type is currently available only in the US (Virginia). When you select Local ISP, only pay-as-you-go is available. If resources are sold out or the quota is exceeded, you cannot place an order. In this case, contact your account manager.

    4. Security protection: This parameter is available only for pay-as-you-go BGP (Multi-ISP) EIPs. For guidance, see Security protection.

    5. IP address pool: If you have an IP address pool, you can allocate an EIP from the pool.

API

Call the AllocateEipAddress operation to create an EIP.

To create EIPs in multiple regions in batches, call the AllocateEipAddress operation in a loop and specify a different RegionId value for each call.

Recover a released public IP

You can request to recover an EIP, or a static public IP address of an ECS or SLB instance that was released from your account within the last seven days.

After a successful request, the system converts the public IP address to a pay-as-you-go EIP that uses the pay-by-data-transfer metering method. The default peak bandwidth is 5 Mbit/s. If your EIP service has been upgraded to CDT-based billing, the data transfer fees for the recovered public IP address are also billed through CDT.

Recovery is not guaranteed. The request may fail if the public IP address has been assigned to another account, locked for security reasons, or reclaimed by the system.

Console

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

  2. Set Request Type to Apply for Specific EIP. After you configure the parameters, click OK.

    1. To request by IP address, enter the public IP address that you previously owned. To retrieve by EIP ID, you can find the historical ID in your historical orders.

    2. If the historical 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 some regions.

      BGP (Multi-ISP) Pro supported regions

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

      • subscription: China (Hong Kong).

    3. You can select a specific IP address pool from the drop-down list to request a specific EIP only if you have enabled the IP address pool feature.

API

Call the AllocateEipAddressPro operation to request a specific EIP.

Request a contiguous EIP block

You can request a contiguous block of EIPs in the following ways:

  • IP address pool: This feature is not available by default. To use it, contact your business manager.

  • Contiguous EIP group: EIPs in a contiguous EIP group are similar to individual EIPs. They can also be associated with cloud resources for internet access and 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 the subscription billing method.

    • You cannot release an individual EIP from a contiguous EIP group. You must release all EIPs in the group at the same time.

Important
  • Starting from 00:00:00 on August 6, 2024 (UTC+8), the contiguous EIP group feature will no longer be available to new users.

  • If you have used the contiguous EIP group feature before 00:00:00 on August 6, 2024 (UTC+8), you can continue to request and use it. However, we recommend that you migrate your contiguous EIP groups to IP address pools.

How to request a contiguous EIP group

Console

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

  2. Set Request Type to Request Contiguous EIP Group. After you configure the parameters, click OK.

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

    2. Metering Method: Select pay-by-bandwidth or pay-by-data-transfer. The metering method is the same as that for individual EIPs. If your EIP service is upgraded to CDT-based billing, the data transfer fees for EIPs in the requested contiguous EIP group are also billed through CDT.

API

Call the AllocateEipSegmentAddress operation to request a contiguous EIP group.

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

The migration process moves the entire CIDR block of the contiguous EIP group into an IP address pool. Before you begin, note the following:

  • The associations between the EIPs and cloud resources are not affected.

  • You cannot roll back the migration.

  • After a successful migration, you are charged a public IP retention fee for the IP address pool.

Console

  1. In the EIP console, select the region of the EIP. Find any EIP in the contiguous EIP group. In the Actions column, click the 更多操作 icon and select Migrate to IP Address Pool.

  2. Review the information in the message and click OK.

  3. After the migration is successful, the IP Address Pool ID column for the EIP displays the ID of the IP address pool to which it belongs.

API

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

Associate an EIP

Prerequisites

The ECS instance must meet the following requirements:

  • The instance is in a VPC.

  • The instance is in the same region as the EIP.

  • The instance is in the Running or Stopped state.

  • The instance's primary network interface has no 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:

  5. Click OK.

    After the association succeeds, 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, associate multiple EIPs with a secondary elastic network interface.

Disassociate an EIP

Disassociate an EIP when you no longer need internet access on the instance or want to change the EIP, to avoid unnecessary costs.

Important

Disassociating an EIP removes internet access. Before you proceed, verify that public access is no longer needed or that an alternative 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.

  5. Click OK.

    Note

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

  6. (Optional) A disassociated EIP still incurs charges. If you no longer need it, release the pay-as-you-go EIP.

Change an EIP

To change an instance's EIP, disassociate the current EIP, then associate a new one.

Prerequisites

  • The ECS instance is in a VPC.

  • The ECS instance is in the Running or Stopped state.

  • The ECS instance is in the same region as the EIP.

  • The ECS instance has no fixed public IP or other associated EIPs.

Procedure

  1. (Optional) Create a new EIP.

  2. Disassociate the EIP currently associated with the ECS instance.

    Important
    • A disassociated pay-as-you-go EIP still incurs a configuration fee. Release it if no longer needed.

    • If you no longer need a subscription EIP after disassociating it, cancel its subscription. See Unsubscription rules.

  3. Associate the new EIP with the ECS instance.

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 outside the Chinese mainland from within it, traffic passes through international carrier routing nodes. International link congestion and carrier egress routing restrictions can cause unstable links, packet loss, or inaccessibility.

    • If your users are primarily in the Chinese mainland, use 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, use 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.

    See Transfer an EIP across accounts.

  3. Can I specify a particular IP address when purchasing an EIP?

    No.

    The system randomly assigns an IP address when you purchase an EIP.

References

Learn about EIP billing, bandwidth, and traffic consumption:

After disassociation, the instance loses its public IP address. Update related configurations as needed: