Modify ENI attributes, unbind or delete ENIs, and manage ENIs by tag in the ECS console or by calling API operations.
Modify ENI attributes
For a secondary ENI, you can change the name, description, and associated security groups. For the primary ENI, you can change only the name and description. To change the security groups of the primary ENI, change the security groups of the ECS instance to which the ENI is bound.
Considerations
When you replace the security groups of an ENI, note the following items:
-
Security group rules of an ECS instance apply to the primary ENI. To replace the primary ENI's security groups, replace the security groups of the ECS instance. See Add an ECS instance to or remove an ECS instance from security groups or replace the security groups of an ECS instance.
-
A secondary ENI must be associated with at least one security group. Each secondary ENI of an ECS instance can be associated with a limited number of security groups. For more information, see the Limits section of the "Limits" topic.
-
The secondary ENIs of an ECS instance and the security groups to which you want to add the secondary ENIs must use the same network type. If the secondary ENIs of the ECS instance and the security groups use the VPC network type, they must belong to the same VPC.
-
A secondary ENI can be added only to security groups that are of the same type (basic or advanced). For more information, see Basic and advanced security groups.
Procedure
Change the name, description, or security groups of an ENI in the ECS console or by calling an API operation.
Use the ECS console
In the upper-left corner of the page, select a region and resource group.
-
Click the ENI ID to go to the ENI details page.

-
ENI Name: Click the
icon to specify a new name. -
Description: Click the
icon to specify a new description. -
Change Security Groups: Click Change Security Groups. In the Change Security Groups dialog box, add or remove security groups. Retain at least one security group.
-
Call an API operation
-
Call ModifyNetworkInterfaceAttribute to change the name, description, and associated security groups of an ENI.
-
Call DescribeNetworkInterfaceAttribute to query the attributes of an ENI by NetworkInterfaceId.
Unbind an ENI
Unbind a secondary ENI from an ECS instance when the ENI is no longer needed.
Prerequisites
-
The primary ENI cannot be unbound and is released with the instance.
-
The ECS instance from which you want to unbind a secondary ENI is in the Stopped or Running state.
If the instance type does not support hot swapping of secondary ENIs, stop the instance before unbinding.
-
If elastic Remote Direct Memory Access (eRDMA) is enabled for the secondary ENI, stop all applications using eRDMA before unbinding. The eRDMA kernel module cannot release the ENI while user-mode applications are active. An eRDMA-enabled secondary ENI is also called a secondary elastic RDMA interface (ERI).
Procedure
Use the ECS console
In the upper-left corner of the page, select a region and resource group.
-
Find the target secondary ENI in the Bound state and click Unbind in the Actions column.
-
In the Unbind message, confirm and click OK.
If the ENI status changes to Available after refreshing, the ENI is unbound.
Call an API operation
Call DetachNetworkInterface. Set NetworkInterfaceId to the ENI ID and InstanceId to the instance ID.
-
If you used a network configuration file for the ENI and then released the ENI, delete or modify the configuration file and restart the network service to keep ENI information consistent. See Create and use an ENI.
-
After unbinding, you can bind the ENI to a different ECS instance in the same VPC and zone to reuse its network configurations and features, such as network configurations and ENI features. See Bind an ENI to an instance.
Manage ENIs by tag
Use tags to classify ENIs that share characteristics, such as ENIs that belong to the same organization or serve the same purpose.
Tags help you retrieve and manage resources. See Tags and the "Tag limits" section in Limits.
Procedure
In the upper-left corner of the page, select a region and resource group.
-
Find the target ENI. Hover over the
icon in the Tag column and click Edit. -
In the Edit Tags dialog box, select or enter a tag key and value, then click OK.
Delete an ENI
Unbind and delete an ENI that is no longer needed to avoid unnecessary resource costs.
Prerequisites
-
The ENI that you want to delete is in the Available state.
The primary ENI cannot be unbound and is released with the instance.
-
If the secondary ENI is still bound, unbind it first. See Unbind an ENI.
Considerations
-
If Release Disks with Instance is enabled and the ENI has never been unbound, the ENI is deleted when the instance is released.
-
Deleting an ENI automatically removes it from all associated security groups and reclaims all its private IP addresses.
-
Elastic IP addresses (EIPs) associated with the ENI are retained after deletion. Release unused EIPs separately to stop billing. See Release a pay-as-you-go EIP.
Procedure
Use the ECS console
In the upper-left corner of the page, select a region and resource group.
-
Find the target ENI in the Available state and choose in the Actions column.
-
In the message that appears, click OK.
Refresh the ENI list. If the ENI no longer appears, the deletion is successful.
Call an API operation
Call DeleteNetworkInterface. Set NetworkInterfaceId to the ENI ID.



> Delete