If you acquired the permissions to use the multi-EIP-to-ENI mode, you can associate elastic IP addresses (EIPs) with a secondary elastic network interface (ENI) in multi-EIP-to-ENI mode. After EIPs are associated with a secondary ENI in multi-EIP-to-ENI mode, the private IP address of the ENI and the EIPs are both available. You can view the EIPs in the ENI information in the operating system.

Notice Alibaba Cloud no longer accepts new applications for using the multi-EIP-to-ENI mode. If you acquired the permissions to use this feature, you can continue to associate EIPs with a secondary ENI in multi-EIP-to-ENI mode. You can expose an EIP on a secondary ENI by adding a secondary CIDR block to a virtual private cloud (VPC). This way, the EIP is used as the primary private IP address of the secondary ENI and you can query the EIP in the operating system. For more information, see Expose an EIP on an NIC by adding a secondary CIDR block to a VPC.

Prerequisites

  • A secondary ENI is created in a VPC. The secondary ENI and the EIPs that you want to associate with the secondary ENI are created in the same region. For more information, see Create an ENI.
  • The secondary ENI is not associated with an Elastic Compute Service (ECS) instance.

    If the secondary ENI is associated with an ECS instance, you must disassociate the secondary ENI from the ECS instance before you can associate EIPs with the secondary ENI in multi-EIP-to-ENI mode. For more information, see Unbind an ENI.

Background information

EIPs function as NAT IP addresses. In NAT mode, EIPs are assigned to gateways instead of the ENIs of ECS instances. Therefore, you can query only private IP addresses and cannot query EIPs in the operating system. Administrators must manually maintain the mappings between ENIs and EIPs or ECS instances and EIPs. In addition, EIPs that are associated with resources in NAT mode do not support protocols such as H.323, Session Initiation Protocol (SIP), Domain Name System (DNS), or Real Time Streaming Protocol (RTSP).

To resolve this issue, you can associate EIPs with a secondary ENI in multi-EIP-to-ENI mode. This way, the EIPs are exposed on the ENI in the operating system. After you associate EIPs with a secondary ENI in multi-EIP-to-ENI mode:
  • The private network feature of the secondary ENI is still available.
  • The EIPs are exposed on the secondary ENI in the operating system. After you configure static IP addresses in the operating system, you can run the ifconfig or ipconfig command to query the EIPs of the ENI.
  • EIPs support all IP protocols, including FTP, H.323, SIP, DNS, RTSP, and TFTP.
  • A secondary ENI can be associated with at most 10 EIPs.

Procedure

  1. Log on to the Elastic IP Address console .
  2. In the top navigation bar, select the region where the EIP is created.
    Note The multi-EIP-to-ENI mode is supported in the following regions: China (Shenzhen), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Chengdu), Singapore (Singapore), Germany (Frankfurt), India (Mumbai), US (Virginia), and UK (London).
  3. On the Elastic IP Addresses page, find the EIP that you created and click Bind Resource in the Actions column.
  4. In the Associate EIP with Resource dialog box, set the following parameters and click OK.
    Parameter Description
    Instance Type Select Secondary ENI.
    Mode Select Multi-EIP to ENI Mode.
    Select an instance to associate. Select the secondary ENI with which you want to associate the EIP.
  5. To associate more EIPs with the secondary ENI, repeat the preceding steps.
  6. Then, click the associated ENI.
    View the associated ENI
  7. On the Network Interfaces page, click Bind to Instance to associate the ENI with an ECS instance.
    Note
    • If a secondary ENI is associated with EIPs in multi-EIP-to-ENI mode and you want to associate the secondary ENI with an ECS instance, the ECS instance must belong to one of the following instance families: ecs.d1ne, ecs.ebmc4, ecs.ebmg5, ecs.ebmhfg5, ecs.f1, ecs.gn5i, ecs.gn6v, ecs.i2, ecs.r1, ecs.re4, ecs.re4e, ecs.sccg5, ecs.sccgn6, ecs.scch5, ecs.c5, ecs.r5, ecs.sn2ne, ecs.se1ne, and ecs.sn1ne. For more information, see Instance family.
    • After you associate EIPs with a secondary ENI in multi-EIP-to-ENI mode and associate the secondary ENI with an ECS instance, you must enable Dynamic Host Configuration Protocol (DHCP) for the ECS instance. Otherwise, the multi-EIP-to-ENI mode does not take effect.
  8. Call the DescribeEipGatewayInfo operation to query the gateways and subnet masks of the EIPs. For more information, see DescribeEipGatewayInfo.
  9. Log on to the ECS instance and configure the EIPs for the ECS instance. For more information, see Configure EIPs for an ECS instance that runs Windows and Configure EIPs for an ECS instance that runs Linux.
    Notice The preceding topics describe how to configure secondary private IP addresses for ECS instances. You can follow the same procedure to configure EIPs for ECS instances. However, you must specify the gateways and subnet masks of EIPs instead of the gateways and subnet masks of secondary private IP addresses.
    After you configure the EIPs for the ECS instance, you can run the ifconfig or ipconfig command to query the EIPs.