All Products
Search
Document Center

Elastic Compute Service:AssignIpv6Addresses

Last Updated:Mar 19, 2024

Assigns one or more IPv6 addresses to an elastic network interface (ENI).

Operation description

You can specify IPv6 addresses within the CIDR block of the vSwitch that is connected to the ENI, or specify the number of IPv6 addresses that are automatically generated for the ENI. When you call this operation, take note of the following items:

  • IPv6 must be enabled for the vSwitch with which the ENI is associated. For more information, see Enable IPv6 for a vSwitch.

  • The ENI must be in the Available (Available) or InUse (InUse) state.

  • If you want to assign IPv6 addresses to a primary ENI, make sure that the instance to which the ENI is attached is in the Running (Running) or Stopped (Stopped) state.

  • The maximum number of IPv6 addresses that can be assigned to an ENI varies based on the instance type.

    • If the ENI is in the Available (Available) state, it can be assigned a maximum of 10 IPv6 addresses.
    • If the ENI is already attached to an Elastic Compute Service (ECS) instance, the maximum number of IPv6 addresses that can be assigned to the ENI varies based on the instance type. For more information, see Overview of instance families.
  • After the operation is called, the IPv6 addresses that are assigned to the ENI can be obtained from the response.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
NetworkInterfaceIdstringYes

The ENI ID.

eni-bp1iqejowblx6h8j****
Ipv6AddressCountintegerNo

The number of IPv6 addresses that you want to generate at random for the ENI. Valid values: 1 to 10.

Note You must specify Ipv6Addresses.N or Ipv6AddressCount but cannot specify both.
1
Ipv6AddressarrayNo

The IPv6 addresses that you want to assign to the ENI. You can specify up to 10 IPv6 addresses.

Example: Ipv6Address.1=2001:db8:1234:1a00::****

Note You must specify Ipv6Addresses.N or Ipv6AddressCount but cannot specify both.
stringNo

The IPv6 addresses that you want to assign to the ENI. You can specify up to 10 IPv6 addresses.

Example: Ipv6Address.1=2001:db8:1234:1a00::****

Note You must specify Ipv6Addresses.N or Ipv6AddressCount but cannot specify both.
2001:db8:1234:1a00::****
Ipv6PrefixarrayNo
Note This parameter is in invitational preview and is unavailable for general users.
stringNo
Note This parameter and is unavailable for general users.
hide
Ipv6PrefixCountintegerNo
Note This parameter is in invitational preview and is unavailable for general users.
hide

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
NetworkInterfaceIdstring

The ENI ID.

eni-bp1iqejowblx6h8j****
Ipv6Setsarray

The IPv6 addresses assigned to the ENI.

string

The IPv6 addresses assigned to the ENI.

2001:db8:1234:1a00::****
Ipv6PrefixSetsarray
Note This parameter is in invitational preview and is unavailable for general users.
string
Note This parameter is in invitational preview and is unavailable for general users.
hide

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "NetworkInterfaceId": "eni-bp1iqejowblx6h8j****",
  "Ipv6Sets": {
    "Ipv6Address": [
      "2001:db8:1234:1a00::****"
    ]
  },
  "Ipv6PrefixSets": {
    "Ipv6Prefix": [
      "hide"
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400UnsupportedParameter%sThe parameter is not supported.
400InvalidParameter%sThe specified parameter is invalid.
400InvalidInstanceID.Malformed%sThe specified InstanceId parameter is invalid.
400MissingParameter%sA parameter is not specified.
400InValidParameter%sThe specified parameter is invalid.
400InvalidParams.EniId%sThe specified EniId parameter is invalid.
400InvalidOperation.InvalidEcsState%s-
400InvalidOperation.InvalidEniState%s-
400InvalidPrivateIpAddress.DuplicatedSpecified private IP address is duplicated.The specified private IP address is already in use. Try a different IP address.
400IncorrectVSwitchStatusThe current status of vSwitch does not support this operation.-
400InvalidParameter.Conflict%sThe specified parameter is invalid. Check whether parameter conflicts exist. %s is a variable. An error message is dynamically returned based on call conditions.
403InvalidUserType.NotSupported%sYour account does not support this operation.
403Abs.InvalidAccount.NotFound%sYour Alibaba Cloud account does not exist or your AccessKey pair has expired.
403Forbedden.NotSupportRAM%sRAM users are not authorized to perform this operation.
403Forbbiden.SubUser%sYou are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization.
403InvalidOperation.InvalidEniType%s-
403MaxEniIpv6IpsCountExceeded%sThe maximum number of IPv6 addresses that can be assigned to the ENI has been reached.
403InvalidIp.IpUnassigned%sThe specified IP address is not assigned.
403InvalidIp.IpRepeated%sThe specified IP address already exists.
403InvalidIp.IpAssigned%sThe specified IP address is already assigned.
403InvalidIp.Address%s-
403InvalidOperation.EniCountExceeded%s-
403InvalidOperation.Ipv4CountExceeded%sThe operation is valid because the maximum number of IPv4 addresses has been reached.
403InvalidOperation.Ipv6CountExceeded%sThe operation is valid because the maximum number of IPv6 addresses has been reached.
403InvalidOperation.Ipv6NotSupport%s-
403InvalidOperation.Ipv4NotSupport%s-
403InvalidVSwitch.Ipv6NotTurnOn%sThe IPv6 feature is not enabled for your current vSwitch. Enable the feature and try again.
403InvalidParam.IpAssign%s-
403InvalidVSwitchId.IpInvalid%sThe specified private IP address is invalid.
403Forbidden.RegionId%sThe service is unavailable in the current region.
403InvalidOperation.EniServiceManaged%sThe operation is invalid.
403SecurityGroupInstanceLimitExceed%s-
403InvalidOperation.HighPerformanceTrafficModeEniNotSupport%s-
403InvalidOperation.EniTypeNotSupportThe member eni does not support ipv6.-
403InvalidIp.IpPrefixIllegalThe ip prefixes %s is/are illegal.The IP address prefix is invalid and is not in the CIDR format.
403InvalidIp.IpPrefixMaskIllegalThe ip prefix mask is illegal.The IP address prefix mask is invalid.
403InvalidIp.IpPrefixMaskInvalidThe ip prefixes mask %s is illegal which must be between %s and %s.The IP address prefix mask is invalid and is not within the valid range.
403InvalidIp.IpPrefixMaskNotSameThe ip prefixes %s are illegal which mask must be same.The IP address prefix masks are not the same.
403InvalidIp.IpPrefixMustInReserveSegmentThe ip prefix must in vswitch reserve segment.The IP address prefix is invalid and is not in the reserved CIDR block of the vSwitch.
403InvalidIp.IpPrefixNotAvailableThe ip prefix is/are not available.The IP address prefix is not available.
403InvalidIp.IpPrefixNotStrictThe ip prefix must be strict cidr format.The IP address prefix is invalid and is not in the CIDR format.
403InvalidVSwitchId.IpPrefixNotEnoughThe specified vSwitch has not enough ip prefix.The number of IP address prefixes in the specified vSwitch is insufficient.
403MissingParameterThese parameters %s cannot be both empty.A required parameter is not specified. The required parameters cannot be empty.
404InvalidEniId.NotFound%sThe specified ENI ID does not exist.
404MaxEniIpv6IpsCountExceededThe ipv6 address count exceed limitation.-
404InvalidOperation.VSwitchIpv6DisabledThe specified VSwitch does not support Ipv6 feature.The specified VSwitch does not support IPv6.
404InvalidOperation.EnableIpv6FailedThe specified VSwitch does not support Ipv6 feature.-
404InvalidIp.IpAssignedThe specified ipv6 has already been allocated.-
404InvalidVSwitchId.IpInvalidThe specified ipv6 does not match VSwitch cidr scope.-
404InvalidOperation.HasIpv6RouteEntryThe specified eni has been pointed to the next hop of the route.-
404InvalidOperation.VSwitchCidrReservationNotExistThe specified vSwitch has no cidr reservation.-
500InvalidOperation.RegionNotSupportIpPrefixThe current region does not support ip prefix.You cannot assign IP address prefixes in this region.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-04-26The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 404 change
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 500
2021-07-05The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    Error Codes 404 change
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.