All Products
Search
Document Center

Elastic Compute Service:ModifyNetworkInterfaceAttribute

Last Updated:Apr 04, 2026

Modifies attributes of an elastic network interface (ENI), including the number of queues, associated security groups, queue depth, communication mode, and whether the interface is retained on instance release.

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:ModifyNetworkInterfaceAttribute

update

*NetworkInterface

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

*SecurityGroup

acs:ecs:{#regionId}:{#accountId}:securitygroup/{#securitygroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region where the elastic network interface (ENI) is located. You can call the DescribeRegions operation to query the latest list of Alibaba Cloud regions.

cn-hangzhou

RegionId

string

Yes

The ID of the region where the elastic network interface is located. You can call the DescribeRegions operation to query the latest list of Alibaba Cloud regions.

cn-hangzhou

NetworkInterfaceName

string

No

The name of the ENI. The name must be 2 to 128 characters long. It must start with a letter or a Chinese character, and cannot start with http:// or https://. It can contain letters, digits, Chinese characters, colons (:), underscores (_), periods (.), and hyphens (-).

Default value: empty.

eniTestName

NetworkInterfaceId

string

Yes

The ID of the elastic network interface.

eni-bp67acfmxazb4p****

QueueNumber

integer

No

The number of queues for the ENI. Valid values: 1 to 2048.

  • You can modify the queue count for an ENI that is in the Available state or is attached (InUse) to an instance that is in the Stopped state.

  • The number of queues for the ENI cannot exceed the instance type's limit for queues per ENI. The total number of queues for all ENIs attached to the instance cannot exceed the instance type's total queue quota. You can call the DescribeInstanceTypes operation and check the values of the MaximumQueueNumberPerEni and TotalEniQueueQuantity parameters to obtain the limits for the instance type.

8

Description

string

No

The description of the ENI. The description must be 2 to 255 characters long and cannot start with http:// or https://.

Default value: empty.

testDescription

SecurityGroupId

array

No

The IDs of one or more security groups. The specified security groups replace the current ones associated with the secondary network interface.

  • The number of security groups that you can specify is subject to a quota. For more information, see Limits.

  • The change takes effect almost immediately, but you may experience a brief delay.

string

No

A security group ID.

  • The number of security groups that you can specify is determined by the quota on the number of security groups to which an ENI can be associated. For more information, see Limits.

  • Security groups can be modified only for secondary network interfaces.

  • After you set this parameter, the secondary ENI joins the specified security groups and is removed from its current ones.

  • The change takes effect almost immediately, but you may experience a brief delay.

sg-bp67acfmxazb4p****

DeleteOnRelease

boolean

No

Specifies whether to release the ENI when the instance to which it is attached is released. Valid values:

  • true: The ENI is released.

  • false: The ENI is retained.

true

RxQueueSize

integer

No

The receive (Rx) queue depth of the ENI.

Note

This parameter is in private preview. To request access, submit a ticket.

  • This parameter applies only to 7th-generation and later ECS instance types.

  • This parameter applies only to Linux images.

  • A greater Rx queue depth can improve inbound throughput and reduce packet loss, but it consumes more memory.

8192

TxQueueSize

integer

No

The transmit (Tx) queue depth of the ENI.

Note

This parameter is in private preview. To request access, submit a ticket.

  • This parameter applies only to 7th-generation and later ECS instance types.

  • This parameter applies only to Linux images.

  • A greater Tx queue depth can improve outbound throughput and reduce packet loss, but it consumes more memory.

8192

NetworkInterfaceTrafficConfig

object

No

The communication parameters of the ENI.

NetworkInterfaceTrafficMode

string

No

The communication mode of the ENI. Valid values:

  • Standard: uses the TCP communication mode.

  • HighPerformance: enables the Elastic RDMA Interface (ERI) feature and uses the RDMA communication mode.

When the ENI is in the InUse state:

  • The total number of ERI-enabled ENIs on an instance cannot exceed the instance type's ERI quota. You can call the DescribeInstanceTypes operation and check the value of the EriQuantity parameter to obtain the quota.

Note

This parameter is in private preview.

HighPerformance

QueueNumber

integer

No

The number of queues for the ENI. When the ENI is in the InUse state, take note of the following:

  • The number of queues cannot exceed the maximum number of queues per ENI that is supported by the instance type.

  • The total number of queues for all ENIs attached to the instance cannot exceed the total queue quota for the instance type. You can call the DescribeInstanceTypes operation and check the values of the MaximumQueueNumberPerEni and TotalEniQueueQuantity parameters to obtain the limits for the instance type.

Note

This parameter is in private preview.

8

QueuePairNumber

integer

No

The number of queues for the RDMA-enabled ENI. When the ENI is in the InUse state, take note of the following:

  • The number of queues cannot exceed the maximum number of queues for a single RDMA-enabled ENI that is supported by the instance type. You can call the DescribeInstanceTypes operation and check the value of the QueuePairNumber parameter to obtain the limit.

Note

This parameter is in private preview.

8

RxQueueSize

integer

No

The receive (Rx) queue depth of the ENI.

Note

This parameter is in private preview. To request access, submit a ticket.

  • This parameter applies only to 7th-generation and later ECS instance types.

  • This parameter applies only to Linux images.

  • A greater Rx queue depth can improve inbound throughput and reduce packet loss, but it consumes more memory.

8192

TxQueueSize

integer

No

The transmit (Tx) queue depth of the ENI.

Note

This parameter is in private preview. To request access, submit a ticket.

  • This parameter applies only to 7th-generation and later ECS instance types.

  • This parameter applies only to Linux images.

  • A greater Tx queue depth can improve outbound throughput and reduce packet loss, but it consumes more memory.

8192

ConnectionTrackingConfiguration

object

No

The connection tracking configuration.

For more information, see Connection timeout management.

TcpEstablishedTimeout

integer

No

The timeout period for TCP connections in the ESTABLISHED state, in seconds. Valid values are 30, 60, 80, 100, 200, 300, 500, 700, and 910.

Default value: 910.

910

TcpClosedAndTimeWaitTimeout

integer

No

The timeout period, in seconds, for TCP connections in the FIN-WAIT-2 and TIME-WAIT states. The value must be an integer from 3 to 15.

Default value: 3.

Note

When the ECS instance is behind a Network Load Balancer (NLB) or Classic Load Balancer (CLB) instance, the default timeout for connections in the TIME_WAIT state is 15 seconds.

3

UdpTimeout

integer

No

The timeout period for UDP streams, in seconds. Valid values: 10, 20, 30, 60, 80, and 100.

Default value: 30.

Note

When the ECS instance is behind an NLB or CLB instance, the default value is 100 seconds.

30

EnhancedNetwork

object

No

This parameter is not publicly available.

EnableSriov

boolean

No

This parameter is not publicly available.

true

EnableRss

boolean

No

Note

This parameter is not publicly available.

false

VirtualFunctionTotalQueueNumber

integer

No

VirtualFunctionQuantity

integer

No

SourceDestCheck

boolean

No

Specifies whether to enable source/destination check. Enabling this feature enhances network security. Valid values:

  • true: Enables source/destination check.

  • false: Disables source/destination check.

Default value: false.

Note

This feature is available only in specific regions. For more information, see Source/destination check.

false

Response elements

Element

Type

Description

Example

object

The data returned for the request.

RequestId

string

A unique identifier for the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidOperation.NotSupportModifyQueueNumber %s
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
400 InvalidOperation.InvalidEniState %s
400 InvalidOperation.DetachPrimaryEniNotAllowed %s
400 InvalidParams.EniId %s The specified EniId parameter is invalid.
400 Forbidden.RegionId %s The service is unavailable in the current region.
400 JoinedGroupLimitExceed %s The maximum number of security groups to which the specified resource can be added has been reached. For more information, see the return value of the %s placeholder in the error message.
400 InvalidEniQueueSize.RegionOrUserNotSupported The specified parameter RxQueueSize or TxQueueSize is not supported in this region, or this account is not in the whitelist of using eni QueueSize. You are not authorized to specify the length of NIC queues or cannot specify the length of NIC queues in the current region.
400 InvalidParameter.EniQueueSize The specified parameter TxQueueSize and RxQueueSize are not equal or exceed limit. The specified parameter TxQueueSize and RxQueueSize are not equal or exceed limit.
400 InvalidParameter.Conflict %s The specified parameter is invalid. Check whether parameter conflicts exist. %s is a variable. An error message is dynamically returned based on call conditions.
400 InvalidConnectionTrackingConfiguration.RegionOrUserNotSupported The specified parameter ConnectionTrackingConfiguration is not supported in this region, or this account is not in the whitelist of using network interface ConnectionTrackingConfiguration. The specified parameter ConnectionTrackingConfiguration is not supported in this region, or this account is not in the whitelist of using network interface ConnectionTrackingConfiguration.
400 InvalidParameter.InvalidQueuePairNumber The specified parameter QueuePairNumber exceeds limit. The number of queues on the specified ERI exceeds the limit.
400 InvalidParameter.EniConnectionTrackingConfiguration The specify network interface connection tracking configuration exceeds limit. The network connection configuration of the ENI is out of range.
400 InvalidOperation.MaxEniQueuePairNumberExceed The QueuePairNumber on the RDMA ENI exceeds the upper limit allowed for a single ENI. The number of RDMA queues on the ENI exceeds the maximum number of RDMA queues allowed per ENI.
400 InvalidOperation.HighPerformanceEniPerInstanceLimitExceeded The number of RDMA ENIs attached to the ECS instance exceeds the upper limit. The number of eRDMA interfaces (ERIs) on the ECS instance to which the ENI is attached exceeds the upper limit.
400 InvalidOperation.InstanceTypeNotSupportHighPerformance The ECS instance type where the ENI is located does not support the RDMA mode. The instance type of the ECS instance to which the ENI is attached does not support the RDMA communication mode.
400 InvalidTrafficMode.ModifyToStandardNotSupported The specified parameter NetworkInterfaceTrafficMode is not supported to modify to Standard. You cannot set the NetworkInterfaceTrafficMode parameter of the ENI to Standard.
400 InvalidOperation.EniTrafficModeNotSupportIPv6 The ENI using High Performance traffic mode does not support IPv6. ENIs that use the RDMA communication mode do not support IPv6.
400 InvalidOperation.EniQueuePairNumberOverflow The RDMA QueuePairNumber of the ECS instance associated with the specified ENI exceeds the limit. The number of RDMA queues on ENIs of the ECS instance to which the specified ENI is attached exceeds the upper limit.
400 InvalidParameter.QueuePairNumberMustEmpty When the traffic mode is set to Standard, the QueuePairNumber must be empty. When you create an ENI that uses the TCP communication mode, do not specify the number of RDMA queues for the ENI.
400 InvalidParameter.EniTrafficMode The ENI traffic mode is set incorrectly, it must be either Standard or HighPerformance. The NetworkInterfaceTrafficMode value is invalid. Valid values: Standard and HighPerformance.
400 InvalidOperation.InstanceTypeNotSupportRss The ECS instance type does not support Rss. The ECS instance type does not support Rss.
400 InvalidParameter.EniEnhancedNetwork The input parameter "EnhancedNetwork" is illegal, when EnableSriov is true, VirtualFunctionTotalQueueNumber must not be empty, and VirtualFunctionQuantity must be 1 to 256. When EnableSriov is empty or false, VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity must be empty. The specified network enhancement function parameter is illegal. When the EnableSriov is set to true, the VirtualFunctionTotalQueueNumber must not be empty and the VirtualFunctionQuantity value range is 1-256; When the EnableSriov is empty or set to false, the VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity must be empty
400 InvalidOperation.NotSupportModifyVFQueueNumberAndVFQuantity The ENI not support modify VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity when EnableSriov is true. The ENI not support modify VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity when EnableSriov is true.
400 InvalidOperation.TrunkAttachmentMustEmpty The Attachment of the current Trunk type Network Interface must be empty when modify EnableSriov to true. The Attachment of the current Trunk type Network Interface must be empty when modify EnableSriov to true.
400 Throttling Request was denied due to request throttling, try again later. Requests are too frequent due to resource or account dimensions, please try again later.
400 InvalidOperation.SourceDestCheckUnsupported Modifying sourceDestCheck attribute for network interface is not allowed in the %s region. The current region does not support modifying the ENI SourceDestCheck attributes.
500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error has occurred. Try again later.
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 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
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
403 InvalidOperation.EniServiceManaged %s The operation is invalid.
403 InvalidOperation.MultiGroupType The specified instance can't join different types of security group.
403 InvalidOperation.EniCountExceeded The maximum number of eni in a enterprise level security group is exceeded. The number of NICs in the enterprise security group exceeds the limit.
403 InvalidParams.NetworkInterfaceName %s
403 InvalidOperation.ModifyPrimaryEniQueueNumber Primary NetworkInterface is not allowed to modify queue number.
403 InvalidOperation.InvalidEniState Available status or ECS instance attached is Stopped is allowed to modify network interface queue number.
403 InvalidOperation.ResourceManagedByCloudProduct %s You cannot modify security groups managed by cloud services.
403 InvalidParameter.InvalidEniQueueNumber %s
403 InvalidOperation.MaxEniQueueNumberExceeded %s
403 InvalidOperation.ExceedInstanceTypeQueueNumber %s The maximum number of queues for all ENIs on an instance has been exceeded. For more information, see the return value of the %s placeholder in the error message.
403 AclLimitExceed %s The number of ACL rules for an ENI or instance exceeds the upper limit.
403 InvalidOperation.EniTypeUnsupported The specified eni type does not supported. The specified business type is not supported.
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.
404 InvalidOperation.PrimaryEniOnlySupportModifyNameAndDesc Primary NetworkInterface is only allowed to modify name and description. Primary ENIs can only have their names and descriptions modified.
404 InvalidParameter.SecurityGroupIdRepeated The specified security group ids has repeated. Duplicate security group IDs are specified. Check whether the specified SecurityGroupIds.N parameter is valid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.