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.
- 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.
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).
- 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.
- Log on to the Elastic IP Address console .
- 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).
- On the Elastic IP Addresses page, find the EIP that you created and click Bind Resource in the Actions column.
- 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.
- To associate more EIPs with the secondary ENI, repeat the preceding steps.
- Then, click the associated ENI.
- On the Network Interfaces page, click Bind to Instance to associate the ENI with an ECS instance. Note
- After you associate EIPs with a secondary ENI in multi-EIP-to-ENI mode, you can associate the secondary ENI with an ECS instance. Make sure that the ECS instance belongs 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.g5, ecs.c5, ecs.r5, ecs.t5, 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.
- You can call the DescribeEipGatewayInfo operation to query the gateway and subnet mask of an EIP. For more information, see DescribeEipGatewayInfo.
- 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.