This topic describes how to associate multiple elastic IP addresses (EIPs) with a secondary elastic network interface (ENI) in multi-EIP-to-ENI mode. This mode allows you to use private and public IP addresses at the same time. You can view the status of the EIPs in the network interface controller (NIC) of the operating system.

Prerequisites

Before you associate an EIP with a secondary ENI in multi-EIP-to-ENI mode, make sure that the following requirements are met:
  • The multi-EIP-to-ENI mode is in public review. To set this mode, submit a ticket.
  • A VPC-connected secondary ENI is created. The secondary ENI and the EIP to be associated with are deployed in the same region. For more information, see Create an ENI.
  • The secondary ENI is not associated with any ECS instance.

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

Background information

An EIP functions as the IP address of a Network Address Translation (NAT) gateway. In NAT mode, the public IP address is assigned to the gateway device instead of the NIC of the ECS instance. In the operating system, only the private IP address of the NIC of the ECS instance is displayed. The public IP address is not displayed. In this case, administrators must manually maintain the mapping between the NIC or server and the public IP address. EIPs that are associated with resources in NAT mode do not support the H.323, SIP, DNS, and RTSP protocols.
In multi-EIP-to-ENI mode, EIPs are displayed on the NIC. In multi-EIP-to-ENI mode:
  • The secondary ENI supports both private and public IP addresses.
  • EIPs are displayed on the NIC. After you configure a static IP address in the operating system, you can run the ifconfig or ipconfig command to query the public address of the ENI.
  • EIPs that are associated with a secondary ENI in multi-EIP-to-ENI mode support all Internet protocols, such as H.323, SIP, DNS, RTSP, FTP, and TFTP.
  • Each secondary ENI can be associated with a maximum of 10 EIPs.

Procedure

  1. Log on to the EIP console.
  2. In the upper-left corner, 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-Beijing Winter Olympics), China (Chengdu), Singapore, Germany (Frankfurt), India (Mumbai), US (Virginia), and UK (London).
  3. On the Elastic IP Addresses page, find the EIP that you want to associate, and then click Bind Resources in the Actions column.
  4. In the Bind Elastic IP Address to Resources dialog box, set the following parameters, and clickOK.
    Parameter Description
    Instance Type Select Secondary ENI.
    Mode Select Multi-EIP to ENI Mode.
    Select an instance to bind Select the secondary ENI to be associated with the EIP.
  5. To associate more EIPs with the secondary ENI, repeat the preceding steps.
  6. Return to the Elastic IP Addresses page and click the ID of 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
    • In the multi-EIP-to-ENI mode, you can associate an EIP with the secondary ENI, and then associate the secondary ENI with an ECS instance. Supported ECS instance families are: ecs.c5-618, ecs.d1ne, ecs.db11-se1ne, ecs.ebma1, ecs.ebmc4, ecs.ebmg4, ecs.ebmg5, ecs.ebmg5ne, ecs.ebmgn5i, ecs.ebmgn5t, ecs.ebmhfg4, ecs.ebmhfg5, ecs.ebmi2, ecs.ebmi3, ecs.ebmr4, ecs.ebmr5, ecs.elmd1ne, ecs.elmdb, ecs.f1, ecs.f2, ecs.g5-618, ecs.gn3, ecs.gn5d, ecs.gn5i, ecs.gn5t, ecs.gn6p, ecs.gn6v, ecs.i2, ecs.r1, ecs.re4, ecs.re4e, ecs.sccg5, ecs.sccgn6, ecs.scch5, ecs.x1.i2, ecs.x1.i5, ecs.x1.i6, ecs.x1.i8, ecs.g5, ecs.c5, ecs.r5, ecs.t5, ecs.sn2ne, ecs.se1ne, and ecs.sn1ne. For more information, see Instance families.
    • After you associate EIPs with the secondary ENI in the multi-EIP-to-ENI mode, you must enable DHCP for the ECS instance that is associated with the secondary ENI. Otherwise, the multi-EIP-to-ENI mode can not take effect.
  8. You can call the DescribeEipGatewayInfo operation to query the gateway and subnet mask information about the EIP. For more information, see DescribeEipGatewayInfo.
  9. Log on to the ECS instance and configure EIPs for the ECS instance. For more information, see Assign a secondary private IP address for a Windows instance and Assign a secondary private IP address to a Linux instance.
    Notice When you configure EIPs for an ECS instance as described in the preceding topics, replace the secondary private IP address with an EIP, and replace the gateway and subnet mask of the secondary private IP address with those of the EIP.
    After you configure the EIP, you can run the ifconfig or ipconfig command to query the EIP.