All Products
Search
Document Center

Elastic Compute Service:DescribeNetworkInterfaces

Last Updated:Oct 16, 2026

Queries the details of one or more Elastic Network Interface (ENI) resources.

Operation description

Operation description

The DescribeNetworkInterfaces operation supports pagination by specifying the MaxResults or NextToken parameter. Usage notes:

  • When paged query the first page, you only need to specify MaxResults to limit the number of entries to return. The NextToken value in the response can be used as the token to query the next page.

  • When paged query subsequent pages, set the NextToken parameter to the NextToken value returned from the previous request, and specify MaxResults to limit the number of entries to return.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeNetworkInterfaces

get

NetworkInterface

acs:ecs:{#regionId}:{#accountId}:eni/{#eniId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

Tag

array<object>

No

The tags.

object

No

Key

string

No

The tag key of the Elastic Network Interface (ENI). Valid values of N: 1 to 20.

TestKey

Value

string

No

The tag value of the Elastic Network Interface (ENI). Valid values of N: 1 to 20.

If you use a single tag to filter resources, the number of resources that match the tag cannot exceed 1,000. If you use multiple tags to filter resources, the number of resources that are attached with multiple tags cannot exceed 1,000. If the number of resources exceeds 1,000, call the ListTagResources operation to query the resources.

TestValue

ResourceGroupId

string

No

The resource group ID. When you use this parameter to filter resources, the number of resources cannot exceed 1,000.

Note

Filtering by the default resource group is not supported.

rg-bp67acfmxazb4p****

VSwitchId

string

No

The vSwitch ID of the Elastic Network Interface (ENI).

vsw-bp16usj2p27htro3****

VpcId

string

No

The VPC ID of the Elastic Network Interface (ENI).

vpc-bp1j7w3gc1cexjqd****

PrimaryIpAddress

string

No

The primary private network IPv4 address of the Elastic Network Interface (ENI).

192.168.**.**

SecurityGroupId

string

No

The security group ID of the secondary ENI.

  • To query the information about secondary ENIs by security group ID, specify this parameter.

  • To query the information about primary ENIs by security group ID, call the DescribeInstances operation and specify the SecurityGroupId parameter.

sg-bp144yr32sx6ndw****

NetworkInterfaceName

string

No

The name of the Elastic Network Interface (ENI). The name must be 2 to 128 characters in length, and can contain characters in the letter categorization of Unicode (including English, Chinese, and digits). It can also contain colons (:), underscores (_), periods (.), and hyphens (-).

test-eni-name

Type

string

No

The Elastic Network Interface (ENI) type. Valid values:

  • Primary: primary network interface controller (NIC).

  • Secondary: secondary ENI.

Default value: empty, which indicates that Elastic Network Interfaces (ENIs) of all types are queried.

Secondary

InstanceId

string

No

The instance ID to which the Elastic Network Interface (ENI) is currently attached.

i-bp1e2l6djkndyuli****

ServiceManaged

boolean

No

Specifies whether the Elastic Network Interface (ENI) is used by an Alibaba Cloud service or a Virtual Network Operator (VNO).

true

Status

string

No

The status of the Elastic Network Interface (ENI). Valid values:

  • Available: active.

  • Attaching: being attached.

  • InUse: attached.

  • Detaching: being detached.

  • Deleting: being deleted.

Default value: empty, which indicates that Elastic Network Interfaces (ENIs) in all states are queried.

Available

PageNumber deprecated

integer

No

Note

[Deprecated] We recommend that you use the MaxResults and NextToken parameters for pagination.

1

PageSize deprecated

integer

No

Note

[Deprecated] We recommend that you use the MaxResults and NextToken parameters for pagination.

100

NextToken

string

No

The pagination token. Set the value to the NextToken value returned from the previous API call.

For more information about how to configure the pagination parameters, see the "Operation description" section.

AAAAAdDWBF2****

MaxResults

integer

No

The maximum number of entries per page for a paging query. Valid values: 10 to 500.

Default value:

  • If this parameter is not specified or the specified value is less than 10, the default value is 10.

  • If the specified value is greater than 500, the default value is 500.

50

PrivateIpAddress

array

No

The secondary private IP IPv4 address of the Elastic Network Interface (ENI). Valid values of N: 1 to 100.

192.168.**.**

string

No

The secondary private IP IPv4 address of the Elastic Network Interface (ENI). Valid values of N: 1 to 100.

192.168.**.**

NetworkInterfaceId

array

No

The Elastic Network Interface (ENI) ID. Valid values of N: 1 to 100.

eni-bp125p95hhdhn3ot****

string

No

The Elastic Network Interface (ENI) ID. Valid values of N: 1 to 100.

eni-bp125p95hhdhn3ot****

Ipv6Address

array

No

The IPv6 address of the Elastic Network Interface (ENI). N indicates that multiple IPv6 addresses can be configured. Valid values of N: 1 to 100.

2408:4321:180:1701:94c7:bc38:3bfa:****

string

No

The IPv6 address of the Elastic Network Interface (ENI). N indicates that multiple IPv6 addresses can be configured. Valid values of N: 1 to 100.

2408:4321:180:1701:94c7:bc38:3bfa:****

Response elements

Element

Type

Description

Example

object

NextToken

string

The pagination token returned by the current call.

AAAAAdDWBF2****

PageSize

integer

The paging query parameter.

Note

This parameter will soon be deprecated. We recommend that you use the NextToken and MaxResults parameters for paging.

1

PageNumber

integer

The paging query parameter.

Note

This parameter will soon be deprecated. We recommend that you use the NextToken and MaxResults parameters for paging.

1

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

TotalCount

integer

The total number of Elastic Network Interface (ENI) resources returned.

Note

When you use the MaxResults and NextToken parameters for a paging query, the returned TotalCount value is meaningless.

2

NetworkInterfaceSets

object

NetworkInterfaceSet

array<object>

The collection of Elastic Network Interface (ENI) information.

array<object>

CreationTime

string

The creation time. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format in accordance with the ISO 8601 standard in UTC.

2019-12-25T12:31:31Z

VpcId

string

The VPC ID of the Elastic Network Interface (ENI).

vpc-bp1j7w3gc1cexjqd****

Type

string

The Elastic Network Interface (ENI) type. Valid values:

  • Primary: primary network interface controller (NIC).

  • Secondary: secondary ENI.

Secondary

Status

string

The status of the Elastic Network Interface (ENI). Valid values:

  • Available: active.

  • Attaching: being attached.

  • InUse: attached.

  • Detaching: being detached.

  • Deleting: being deleted.

Available

NetworkInterfaceTrafficMode

string

The communication mode of the Elastic Network Interface (ENI). Valid values:

  • Standard: TCP communication mode.

  • HighPerformance: RDMA communication mode with Elastic RDMA Interface (ERI) enabled.

Note

The HighPerformance value is supported only by the c7re RDMA-enhanced instance family, and currently this value can only be set in Zone K of the China (Beijing) region.

Standard

NetworkInterfaceName

string

The name of the Elastic Network Interface (ENI).

my-eni-name

MacAddress

string

The MAC address of the Elastic Network Interface (ENI).

00:16:3e:12:**:**

QueuePairNumber

integer

Note

This parameter is in invitational preview and is not available for public use.

0

NetworkInterfaceId

string

The Elastic Network Interface (ENI) ID.

eni-bp125p95hhdhn3ot****

ServiceID

integer

The VNO ID of the Elastic Network Interface (ENI).

12345678910

InstanceId

string

The instance ID to which the Elastic Network Interface (ENI) is attached.

Note

The instance ID is not returned for an Elastic Network Interface (ENI) that is managed and controlled by other Alibaba Cloud services.

i-bp1e2l6djkndyuli****

OwnerId

string

The ID of the Alibaba Cloud account to which the Elastic Network Interface (ENI) belongs.

123456****

ServiceManaged

boolean

Specifies whether the Elastic Network Interface (ENI) is used by an Alibaba Cloud service or a Virtual Network Operator (VNO).

true

VSwitchId

string

The vSwitch ID of the VPC.

vsw-bp16usj2p27htro3****

Description

string

The description.

DescriptionTest

ResourceGroupId

string

The resource group ID.

rg-2ze88m67qx5z****

ZoneId

string

The zone ID.

cn-hangzhou-e

PrivateIpAddress

string

The private IP address of the Elastic Network Interface (ENI).

172.17.**.**

QueueNumber

integer

The number of queues for the Elastic Network Interface (ENI).

  • If the secondary ENI is in the attached (InUse) state and the number of queues has not been modified, the default number of queues for secondary ENIs of the instance type is returned.

  • If the number of queues for the secondary ENI has been modified, the modified number is returned.

  • If the secondary ENI is in the unattached (Available) state and the number of queues has not been modified, an empty value is returned.

  • For a primary network interface controller (NIC), the default number of queues for primary network interface controller (NIC) of the instance type is returned.

8

PrivateIpSets

object

PrivateIpSet

array<object>

The PrivateIpSet collection.

array<object>

PrivateIpAddress

string

The private IP address of the instance.

172.17.**.**

Primary

boolean

Specifies whether the private IP address is the primary private IP address. Valid values:

  • true: The private IP address is the primary private IP address.

  • false: The private IP address is a secondary private IP address.

true

AssociatedPublicIp

object

The Elastic IP Address (EIP) associated with the Elastic Network Interface (ENI).

PublicIpAddress

string

The EIP.

116.62.**.**

AllocationId

string

Note

This parameter is in invitational preview and is not available for public use.

null

PrivateDnsName

string

The private domain name of the instance.

Note

A private domain name in a fixed format is returned only when the HostnameType parameter of the instance is set to IP or InstanceId.

DnsTestName

Ipv6Sets

object

Ipv6Set

array<object>

The collection of IPv6 addresses allocated to the Elastic Network Interface (ENI).

object

Ipv6Address

string

The IPv6 address allocated to the Elastic Network Interface (ENI).

2408:4321:180:1701:94c7:bc38:3bfa:****

Primary

boolean

Ipv4PrefixSets

object

Ipv4PrefixSet

array<object>

The collection of IPv4 prefixes allocated to the Elastic Network Interface (ENI).

object

Ipv4Prefix

string

The IPv4 prefix allocated to the Elastic Network Interface (ENI).

192.168.**.0/28

Ipv6PrefixSets

object

Ipv6PrefixSet

array<object>

The collection of IPv6 prefixes allocated to the Elastic Network Interface (ENI).

object

Ipv6Prefix

string

The IPv6 prefix allocated to the Elastic Network Interface (ENI).

2001:db8:1234:1a00:****::/80

Tags

object

Tag

array<object>

The tags.

object

TagValue

string

The tag value.

TestValue

TagKey

string

The tag key.

TestKey

SecurityGroupIds

object

SecurityGroupId

array

The collection of security groups to which the ENI belongs.

string

The security group ID.

sg-bp18kz60mefsicfg****

AssociatedPublicIp

object

The Elastic IP Address (EIP) associated with the secondary private IP address of the Elastic Network Interface (ENI).

PublicIpAddress

string

The EIP.

116.62.**.**

AllocationId

string

Note

This parameter is in invitational preview and is not available for public use.

null

Attachment

object

Note

This parameter is in invitational preview and is not available for public use.

DeviceIndex

integer

Note

This parameter is in invitational preview and is not available for public use.

0

InstanceId

string

Note

This parameter is in invitational preview and is not available for public use.

null

TrunkNetworkInterfaceId

string

Note

This parameter is in invitational preview and is not available for public use.

null

NetworkCardIndex

integer

The index of the physical network card to which the ENI is attached.

  • If the ENI is in the Available state or no index was specified when the ENI was attached, this value is not returned.

  • If the ENI is in the InUse state and an index was specified when the ENI was attached, this value indicates the index of the physical network card to which the ENI is attached.

0

DeleteOnRelease

boolean

Specifies whether to retain the ENI when the instance is released. Valid values:

  • true: The ENI is not retained.

  • false: The ENI is retained.

true

SourceDestCheck

boolean

Specifies whether to enable source/destination checking. We recommend that you enable this feature to improve network security. Valid values:

  • true: Enabled.

  • false: Disabled.

Default value: false.

Note

Before using this parameter, carefully read Source/destination checking.

false

Examples

Success response

JSON format

{
  "NextToken": "AAAAAdDWBF2****",
  "PageSize": 1,
  "PageNumber": 1,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "TotalCount": 2,
  "NetworkInterfaceSets": {
    "NetworkInterfaceSet": [
      {
        "CreationTime": "2019-12-25T12:31:31Z",
        "VpcId": "vpc-bp1j7w3gc1cexjqd****",
        "Type": "Secondary",
        "Status": "Available",
        "NetworkInterfaceTrafficMode": "Standard",
        "NetworkInterfaceName": "my-eni-name",
        "MacAddress": "00:16:3e:12:**:**",
        "QueuePairNumber": 0,
        "NetworkInterfaceId": "eni-bp125p95hhdhn3ot****",
        "ServiceID": 12345678910,
        "InstanceId": "i-bp1e2l6djkndyuli****",
        "OwnerId": "123456****",
        "ServiceManaged": true,
        "VSwitchId": "vsw-bp16usj2p27htro3****",
        "Description": "DescriptionTest",
        "ResourceGroupId": "rg-2ze88m67qx5z****",
        "ZoneId": "cn-hangzhou-e",
        "PrivateIpAddress": "172.17.**.**",
        "QueueNumber": 8,
        "PrivateIpSets": {
          "PrivateIpSet": [
            {
              "PrivateIpAddress": "172.17.**.**",
              "Primary": true,
              "AssociatedPublicIp": {
                "PublicIpAddress": "116.62.**.**",
                "AllocationId": "null"
              },
              "PrivateDnsName": "DnsTestName"
            }
          ]
        },
        "Ipv6Sets": {
          "Ipv6Set": [
            {
              "Ipv6Address": "2408:4321:180:1701:94c7:bc38:3bfa:****",
              "Primary": false
            }
          ]
        },
        "Ipv4PrefixSets": {
          "Ipv4PrefixSet": [
            {
              "Ipv4Prefix": "192.168.**.0/28"
            }
          ]
        },
        "Ipv6PrefixSets": {
          "Ipv6PrefixSet": [
            {
              "Ipv6Prefix": "2001:db8:1234:1a00:****::/80"
            }
          ]
        },
        "Tags": {
          "Tag": [
            {
              "TagValue": "TestValue",
              "TagKey": "TestKey"
            }
          ]
        },
        "SecurityGroupIds": {
          "SecurityGroupId": [
            "sg-bp18kz60mefsicfg****"
          ]
        },
        "AssociatedPublicIp": {
          "PublicIpAddress": "116.62.**.**",
          "AllocationId": "null"
        },
        "Attachment": {
          "DeviceIndex": 0,
          "InstanceId": "null",
          "TrunkNetworkInterfaceId": "null",
          "NetworkCardIndex": 0
        },
        "DeleteOnRelease": true,
        "SourceDestCheck": false
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 MissingParameter %s A parameter is not specified.
400 UnsupportedParameter %s The parameter is not supported.
400 InvalidParameter %s The specified parameter is invalid.
400 InvalidInstanceID.Malformed %s The specified InstanceId parameter is invalid.
400 InvalidOperation.InvalidEcsState %s This operation is not allowed due to the current status of the cloud service.
400 InvalidOperation.InvalidEniState %s The current status of the ENI does not support this operation.
400 InvalidOperation.DetachPrimaryEniNotAllowed %s You cannot detach the primary ENI from an instance.
400 Forbidden.RegionId %s The service is unavailable in the current region.
400 InvalidRegionId.MalFormed The specified parameter RegionId is not valid. The specified RegionId parameter is invalid.
403 InvalidUserType.NotSupported %s Your account does not support this operation.
403 Abs.InvalidAccount.NotFound %s Your Alibaba Cloud account does not exist or your AccessKey pair has expired.
403 Forbidden.NotSupportRAM %s RAM users are not authorized to perform this operation.
403 Forbidden.SubUser %s You are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization.
403 InvalidParameter %s
403 MaxEniCountExceeded %s The maximum number of ENIs that can be managed has been reached.
403 EniPerInstanceLimitExceeded %s The maximum number of ENIs that can be attached to the specified instance has been reached.
403 InvalidOperation.AvailabilityZoneMismatch %s The operation is invalid.
403 InvalidOperation.VpcMismatch %s The operation is invalid. Check whether the VPC in the operation corresponds to other parameters.
403 SecurityGroupInstanceLimitExceed %s The maximum number of instances in the security group has been reached.
403 InvalidSecurityGroupId.NotVpc %s The specified SecurityGroupId parameter is invalid and the network type of the security group is not VPC.
403 InvalidOperation.InvalidEniType %s This operation is not allowed for the current network interface type.
403 InvalidVpc.Empty %s No vSwitches exist in the specified VPC. For more information, see the return value of the %s placeholder in the error message.
403 Forbidden.RegionId %s
403 InvalidOperation.InvalidEniPageNumber %s
403 InvalidVpc.Indeterminacy %s
404 InvalidEcsId.NotFound %s The specified instance ID does not exist.
404 InvalidEniId.NotFound %s
404 InvalidVSwitchId.NotFound %s The specified vSwitch does not exist.
404 InvalidSecurityGroupId.NotFound %s The specified security group ID does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.