Use Cases and scenarios
ENI is a virtual network interface that can be attached to a VPC-connected ECS instance, you can achieve high-availability cluster construction, low-cost failover, and refined network management. Elastic network interfaces are supported in all regions.
Use Cases
Enis are applicable to the following scenarios:
Build a high-availability cluster
Meet the requirements of the system high-availability architecture for a single instance with multiple NICs.
Low-cost fault migration
By detaching an Eni from an ECS instance and then attaching it to another ECS instance, the service traffic of the faulty instance is quickly migrated to the standby instance to achieve rapid service recovery.
Refined Network Management
You can configure multiple Enis for an instance, such as an internal ENI for internal management and an Enis for Internet service access, to isolate management data from business data. You can configure precise security group rules for each ENI based on the source IP address, protocol, port, and so on, so as to implement secure access control for each Eni's traffic.
ENI type
There are two types of ENI:
Primary ENI
The ENI created by default when you create a VPC instance is called the primary ENI. The lifecycle of the primary ENI is the same as that of the instance. You cannot detach the primary ENI from the instance.
Secondary ENI
You can create a secondary ENI and attach it to an instance or detach it from the instance. The maximum number of Enis that can be attached to each instance depends on the instance type. For more information, see instance type families.
ENI attributes
The following table lists the information contained in each ENI.
Attribute |
Quantity |
Primary private IP Address |
1 |
MAC address |
1 |
Security Group |
At least 1, up to 5 |
Description |
1 |
Nic name |
1 |
Restrictions
Using an Eni has the following restrictions:
An account can create up to 100 Enis in a region.
The ECS instance and ENI must be in the same zone of the same VPC and can belong to different vswitches.
Only some instance types support attaching an Eni. For more information, see instance type families.
You cannot attach multiple elastic network cards to an instance to increase the bandwidth of the instance.
Note:
The bandwidth capacity of an instance depends on the instance type.
Related Operations
After the instance is created, you can log on to the instance to configure the ENI for some images that cannot automatically recognize the ENI.
Console operations
You can complete the following operations on the ECS console:
Attach an Eni when creating an instance
Create an Eni
Delete an Eni
Attach an Eni to an instance: The instance must be in the stopped status.
Detach an Eni from an instance: The instance must be in the stopped status.
Modify attributes of an Eni: Modify the ENI name, security group, and description.
Query the ENI information attached to an instance on the ECS console.
API operations
You can perform the following operations through the API:
Create an Eni
Delete an Eni
Query the list of Enis
Attach an Eni to an instance: The instance must be in the stopped status.
Detach an Eni from an instance: The instance must be in the stopped status.
Modify attributes of an Eni: Modify the ENI name, security group, and description.
Use the DescribeInstances interface to query the ENI information attached to the instance. <