All Products
Search
Document Center

Elastic Compute Service:Manage ENIs

Last Updated:May 15, 2026

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

  1. Go to ECS Console - Elastic Network Interfaces.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Click the ENI ID to go to the ENI details page.

    image

    • 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

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.

    ECS instance types that do not support the hot swapping feature of secondary ENIs

    Instance family

    Instance type

    s6, shared standard instance family

    ecs.s6-c1m1.small, ecs.s6-c1m2.large, ecs.s6-c1m2.small, ecs.s6-c1m4.large, and ecs.s6-c1m4.small

    e, economy instance family

    ecs.e-c1m1.large, ecs.e-c1m2.large, ecs.e-c1m4.large, ecs.e-c4m1.large, and ecs.e-c2m1.large

    t6, burstable instance family

    ecs.t6-c1m1.large, ecs.t6-c1m2.large, ecs.t6-c1m4.large, ecs.t6-c2m1.large, and ecs.t6-c4m1.large

    t5, burstable instance family

    ecs.t5-c1m1.large, ecs.t5-c1m2.large, ecs.t5-c1m4.large, ecs.t5-lc1m1.small, ecs.t5-lc1m2.large, ecs.t5-lc1m2.small, ecs.t5-lc1m4.large, and ecs.t5-lc2m1.nano

    xn4, n4, mn4, and e4, previous-generation shared instance families

    • ecs.xn4.small

    • ecs.n4.small and ecs.n4.large

    • ecs.mn4.small and ecs.mn4.large

    • ecs.e4.small and ecs.e4.large

  • 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).

    View and stop applications that are using eRDMA

    1. Connect to a Linux instance.

      See Log on to a Linux instance using Workbench.

    2. View the reference count of the eRDMA kernel module:

      lsmod | grep erdma
      • If 0 is returned, no action is required.

        image

      • If a non-zero value is returned, applications are using eRDMA. Stop these applications.

        image

    3. Stop applications using eRDMA until the reference count of the eRDMA kernel module reaches 0.

      Sample command.

      image

Procedure

Use the ECS console

  1. Go to ECS Console - Elastic Network Interfaces.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Find the target secondary ENI in the Bound state and click Unbind in the Actions column.

  4. 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

  1. Go to ECS Console - Elastic Network Interfaces.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Find the target ENI. Hover over the edit-tag icon in the Tag column and click Edit.

  4. 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

  1. Go to ECS Console - Elastic Network Interfaces.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Find the target ENI in the Available state and choose 更多 > Delete in the Actions column.

  4. 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.