All Products
Search
Document Center

Elastic Compute Service:DescribeNetworkInterfaces

Last Updated:Aug 27, 2026

Queries the details of one or more Elastic Network Interfaces (ENIs).

Operation description

Operation description

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

  • When paged query the first page, set only MaxResults to limit the number of entries returned. The NextToken value in the response is used as the credential to query subsequent pages.

  • When paged query subsequent pages, set NextToken to the NextToken value obtained from the previous response, and set MaxResults to limit the number of entries returned.

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 DescribeRegions 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 network interface controller (NIC). Valid values of N: 1 to 20.

TestKey

Value

string

No

The tag value of the network interface controller (NIC). Valid values of N: 1 to 20.

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

TestValue

ResourceGroupId

string

No

The resource group ID. If you use this parameter to filter resources, the resource count cannot exceed 1,000.

Note

Filtering by the default resource group is not supported.

rg-bp67acfmxazb4p****

VSwitchId

string

No

The vSwitch ID of the network interface controller (NIC).

vsw-bp16usj2p27htro3****

VpcId

string

No

The virtual private cloud (VPC) ID of the network interface controller (NIC).

vpc-bp1j7w3gc1cexjqd****

PrimaryIpAddress

string

No

The primary private IP address of the network interface controller (NIC).

192.168.**.**

SecurityGroupId

string

No

The security group ID of the secondary ENI.

  • To query information about a secondary ENI by security group ID, specify this parameter.

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

sg-bp144yr32sx6ndw****

NetworkInterfaceName

string

No

The name of the network interface controller (NIC). The name must be 2 to 128 characters in length and can contain characters from the Unicode letter categorization (which includes English letters, Chinese characters, and digits). The name can contain colons (:), underscores (_), periods (.), or hyphens (-).

test-eni-name

Type

string

No

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

  • Primary: primary network interface controller (NIC).

  • Secondary: secondary ENI.

Default value: null, which indicates that all types are queried.

Secondary

InstanceId

string

No

The instance ID of the instance to which the network interface controller (NIC) is attached.

i-bp1e2l6djkndyuli****

ServiceManaged

boolean

No

Indicates whether the user of the network interface controller (NIC) is an Alibaba Cloud service or a Virtual Network Operator (VNO).

true

Status

string

No

The status of the network interface controller (NIC). Valid values:

  • Available: available.

  • Attaching: being attached.

  • InUse: attached.

  • Detaching: being detached.

  • Deleting: being deleted.

Default value: null, which indicates that all statuses are queried.

Available

PageNumber deprecated

integer

No

Note

This parameter is deprecated. Use the MaxResults and NextToken parameters for pagination.

1

PageSize deprecated

integer

No

Note

This parameter is deprecated. Use the MaxResults and NextToken parameters for pagination.

100

NextToken

string

No

The pagination token. Set this parameter to the NextToken value returned in the previous API call.

For information about how to view the returned data, refer to the operation description above.

AAAAAdDWBF2****

MaxResults

integer

No

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

Default value:

  • If you do not set this parameter or set it to a value less than 10, the default value is 10.

  • If you set this parameter to a value greater than 500, the default value is 500.

50

PrivateIpAddress

array

No

The secondary private IP address of the network interface controller (NIC). Valid values of N: 1 to 100.

192.168.**.**

string

No

The secondary private IP address of the network interface controller (NIC). Valid values of N: 1 to 100.

192.168.**.**

NetworkInterfaceId

array

No

The network interface controller (NIC) ID. Valid values of N: 1 to 100.

eni-bp125p95hhdhn3ot****

string

No

The network interface controller (NIC) ID. Valid values of N: 1 to 100.

eni-bp125p95hhdhn3ot****

Ipv6Address

array

No

The IPv6 address of the network interface controller (NIC). N indicates that you can specify multiple IPv6 addresses. Valid values of N: 1 to 100.

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

string

No

The IPv6 address of the network interface controller (NIC). N indicates that you can specify multiple IPv6 addresses. 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 in this call.

AAAAAdDWBF2****

PageSize

integer

The paging parameter.

Note

This parameter is being deprecated. Use NextToken and MaxResults for paging.

1

PageNumber

integer

The paging parameter.

Note

This parameter is being deprecated. Use NextToken and MaxResults for paging.

1

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

TotalCount

integer

The total number of Elastic Network Interfaces (ENIs) returned.

Note

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

2

NetworkInterfaceSets

object

NetworkInterfaceSet

array<object>

The collection of network interface controller (NIC) information.

array<object>

CreationTime

string

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

2019-12-25T12:31:31Z

VpcId

string

The virtual private cloud (VPC) ID of the network interface controller (NIC).

vpc-bp1j7w3gc1cexjqd****

Type

string

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

  • Primary: primary network interface controller (NIC).

  • Secondary: secondary ENI.

Secondary

Status

string

The status of the network interface controller (NIC). Valid values:

  • Available: available.

  • Attaching: being attached.

  • InUse: attached.

  • Detaching: being detached.

  • Deleting: being deleted.

Available

NetworkInterfaceTrafficMode

string

The communication mode of the network interface controller (NIC). Valid values:

  • Standard: the TCP communication mode is used.

  • HighPerformance: Elastic RDMA Interface (ERI) is enabled and the RDMA communication mode is used.

Note

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

Standard

NetworkInterfaceName

string

The name of the network interface controller (NIC).

my-eni-name

MacAddress

string

The MAC address of the network interface controller (NIC).

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

QueuePairNumber

integer

Note

This parameter is in invitational preview and is not publicly available.

0

NetworkInterfaceId

string

The network interface controller (NIC) ID.

eni-bp125p95hhdhn3ot****

ServiceID

integer

The ID of the Virtual Network Operator (VNO) to which the network interface controller (NIC) belongs.

12345678910

InstanceId

string

The ID of the instance to which the network interface controller (NIC) is attached.

Note

Network interface controllers (NICs) that are managed and controlled by other Alibaba Cloud services do not return an instance ID.

i-bp1e2l6djkndyuli****

OwnerId

string

The ID of the account that owns the network interface controller (NIC).

123456****

ServiceManaged

boolean

Indicates whether the user of the network interface controller (NIC) is 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 network interface controller (NIC).

172.17.**.**

QueueNumber

integer

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

  • If the secondary network interface controller (NIC) is in the attached (InUse) state and the queue number has not been modified, the default queue number for secondary ENIs of the instance type is returned.

  • If the secondary network interface controller (NIC) has had its queue number modified, the modified queue number is returned.

  • If the secondary network interface controller (NIC) is in the unattached (Available) state and the queue number has not been modified, an empty value is returned.

  • For primary network interface controllers (NICs), the default queue number for primary NICs of the instance type is returned.

8

PrivateIpSets

object

PrivateIpSet

array<object>

The collection of PrivateIpSet objects.

array<object>

PrivateIpAddress

string

The private IP address of the instance.

172.17.**.**

Primary

boolean

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

  • true: primary private IP address.

  • false: secondary private IP address.

true

AssociatedPublicIp

object

The Elastic IP Address (EIP) associated with the network interface controller (NIC).

PublicIpAddress

string

The EIP address.

116.62.**.**

AllocationId

string

Note

This parameter is in invitational preview and is not publicly available.

null

PrivateDnsName

string

The private domain name of the instance.

Note

This value is returned only when the hostname type HostnameType of the instance is set to IP format or InstanceId format.

DnsTestName

Ipv6Sets

object

Ipv6Set

array<object>

The IPv6 addresses allocated to the network interface controller (NIC).

object

Ipv6Address

string

The IPv6 address allocated to the network interface controller (NIC).

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

Primary

boolean

Ipv4PrefixSets

object

Ipv4PrefixSet

array<object>

The IPv4 prefixes allocated to the network interface controller (NIC).

object

Ipv4Prefix

string

The IPv4 prefix allocated to the network interface controller (NIC).

192.168.**.0/28

Ipv6PrefixSets

object

Ipv6PrefixSet

array<object>

The IPv6 prefixes allocated to the network interface controller (NIC).

object

Ipv6Prefix

string

The IPv6 prefix allocated to the network interface controller (NIC).

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 security groups to which the ENI belongs.

string

The security group ID.

sg-bp18kz60mefsicfg****

AssociatedPublicIp

object

The EIP associated with the secondary private IP address of the network interface controller (NIC).

PublicIpAddress

string

The EIP address.

116.62.**.**

AllocationId

string

Note

This parameter is in invitational preview and is not publicly available.

null

Attachment

object

Note

This parameter is in invitational preview and is not publicly available.

DeviceIndex

integer

Note

This parameter is in invitational preview and is not publicly available.

0

InstanceId

string

Note

This parameter is in invitational preview and is not publicly available.

null

TrunkNetworkInterfaceId

string

Note

This parameter is in invitational preview and is not publicly available.

null

NetworkCardIndex

integer

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

  • If the ENI is in the Available state or the index was not specified during attachment, this value is not returned.

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

0

DeleteOnRelease

boolean

Indicates whether the ENI is retained when the associated instance is released. Valid values:

  • true: The ENI is not retained.

  • false: The ENI is retained.

true

SourceDestCheck

boolean

Indicates whether source/destination checking is enabled. 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, 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 The current status of the instance does not support this operation.
400 InvalidOperation.InvalidEniState %s The current status of the ENI does not allow modifying the ENI attributes.
400 InvalidOperation.DetachPrimaryEniNotAllowed %s Detaching the primary ENI from an instance is not allowed.
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 number of instances in the security group has reached the maximum limit.
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 The current type of the Elastic Network Interface (ENI) does not support this operation.
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.