An Elastic Network Interface (ENI) is a virtual network interface that can be attached to an ECS instance in a VPC. By using ENIs, you can build high-availability clusters, implement failover at a lower cost, and achieve refined network management. The ENI feature is available in all regions.
ENIs can be used in the following scenarios:
Deploying a high-availability cluster
An ENI can meet the demands of a high-availability architecture for multiple network interfaces on a single instance.
Providing a low-cost failover solution
You can detach an ENI from a failed ECS instance and then attach it to another ECS instance to quickly redirect the failed instance’s traffic to a backup instance. This action recovers the service immediately.
Managing the network with refined controls
You can configure multiple ENIs for an instance. For example, you can use some ENIs for internal management and other ENIs for Internet business access, so as to isolate managerial data from business data. You can also configure precisely-targeted security group rules for each ENI based on the source IP address, protocols, ports, and more to achieve secured traffic control.
ENIs are classified into two types:
The ENI created by default upon the creation of an instance in a VPC is called the primary ENI. The lifecycle of the primary ENI is the same as that of the instance and you are not allowed to remove the primary ENI from the instance.
You can create a secondary ENI and attach it to an instance or detach it from the instance. Multiple private IPs are supported for one secondary ENI. The maximum number of ENIs that you can attach to one instance varies with the instance type. For more information, see Instance type families.
The following table displays ENI attributes.
|Primary private IP addresses||1|
|Secondary private IP addresses||Depends on the instance type.|
|Security group||Min. 1, and Max. 5|
ENIs have the following limits:
By default, one account can own up to 100 ENIs in one region. The quota increases with the membership level. If you require a higher quota, open a ticket.
The ECS instance must be in the same zone of the same region as the ENI, but they do not have to be in the same VSwitch.
The number of ENIs that can be attached to an ECS instance is determined by the instance type. For more information, see Instance type families.
Only I/O optimized instance types support ENIs.
You cannot increase the instance bandwidth capability by attaching multiple ENIs.
Note The instance bandwidth capability varies with the instance type.
For images that cannot identify ENIs, you can log on to the instance to configure the ENI.
You can complete the following operations in the ECS console:
- Attach an ENI when creating an instance
- Create an ENI
- Delete an ENI
- Attach an ENI to an instanceThe instance must be in a Stopped or Running status.
- Detach an ENI from an instanceThe instance must be in a Stopped or Running status.
- Modify attributes of an ENIYou can modify attributes of an ENI, including its name, security group, and description.
- When an ENI is attached to an instance, you can view the information of the ENI on the instance details page and the network interfaces page.
You can complete the following operations by using APIs:
- Create an ENI
- Delete an ENI
- Query ENI list
- Attach an ENI to an instance: The instance must be in a Stopped or Running status.
- Detach an ENI from an instance: The instance must be in a Stopped or Running status.
- Modify attributes of an ENI: You can modify attributes of an ENI, including its name, its security group, and its description.
- You can use the DescribeInstances DescribeInstances interface to query the information of an ENI when the ENI is attached to an instance.