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
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the ENI. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
NetworkInterfaceId | string | Yes | The ENI ID. | eni-bp1iqejowblx6h8j**** |
Ipv6AddressCount | integer | No | 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 |
Ipv6Address | array | No | 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.
| |
string | No | 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::**** | |
Ipv6Prefix | array | No | Note
This parameter is in invitational preview and is unavailable for general users.
| |
string | No | Note
This parameter and is unavailable for general users.
| hide | |
Ipv6PrefixCount | integer | No | Note
This parameter is in invitational preview and is unavailable for general users.
| hide |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"NetworkInterfaceId": "eni-bp1iqejowblx6h8j****",
"Ipv6Sets": {
"Ipv6Address": [
"2001:db8:1234:1a00::****"
]
},
"Ipv6PrefixSets": {
"Ipv6Prefix": [
"hide"
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
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 | MissingParameter | %s | A parameter is not specified. |
400 | InValidParameter | %s | The specified parameter is invalid. |
400 | InvalidParams.EniId | %s | The specified EniId parameter is invalid. |
400 | InvalidOperation.InvalidEcsState | %s | - |
400 | InvalidOperation.InvalidEniState | %s | - |
400 | InvalidPrivateIpAddress.Duplicated | Specified private IP address is duplicated. | - |
400 | IncorrectVSwitchStatus | The current status of vSwitch does not support this operation. | - |
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. |
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 | Forbedden.NotSupportRAM | %s | RAM users are not authorized to perform this operation. |
403 | Forbbiden.SubUser | %s | You are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization. |
403 | InvalidOperation.InvalidEniType | %s | - |
403 | MaxEniIpv6IpsCountExceeded | %s | The maximum number of IPv6 addresses that can be assigned to the ENI has been reached. |
403 | InvalidIp.IpUnassigned | %s | The specified IP address is not assigned. |
403 | InvalidIp.IpRepeated | %s | The specified IP address already exists. |
403 | InvalidIp.IpAssigned | %s | The specified IP address is already assigned. |
403 | InvalidIp.Address | %s | - |
403 | InvalidOperation.EniCountExceeded | %s | - |
403 | InvalidOperation.Ipv4CountExceeded | %s | The operation is valid because the maximum number of IPv4 addresses has been reached. |
403 | InvalidOperation.Ipv6CountExceeded | %s | The operation is valid because the maximum number of IPv6 addresses has been reached. |
403 | InvalidOperation.Ipv6NotSupport | %s | - |
403 | InvalidOperation.Ipv4NotSupport | %s | - |
403 | InvalidVSwitch.Ipv6NotTurnOn | %s | The IPv6 feature is not enabled for your current vSwitch. Enable the feature and try again. |
403 | InvalidParam.IpAssign | %s | - |
403 | InvalidVSwitchId.IpInvalid | %s | The specified private IP address is invalid. |
403 | Forbidden.RegionId | %s | The service is unavailable in the current region. |
403 | InvalidOperation.EniServiceManaged | %s | The operation is invalid. |
403 | SecurityGroupInstanceLimitExceed | %s | - |
403 | InvalidOperation.HighPerformanceTrafficModeEniNotSupport | %s | - |
403 | InvalidOperation.EniTypeNotSupport | The member eni does not support ipv6. | - |
403 | InvalidIp.IpPrefixIllegal | The ip prefixes %s is/are illegal. | The IP address prefix is invalid and is not in the CIDR format. |
403 | InvalidIp.IpPrefixMaskIllegal | The ip prefix mask is illegal. | The IP address prefix mask is invalid. |
403 | InvalidIp.IpPrefixMaskInvalid | The 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. |
403 | InvalidIp.IpPrefixMaskNotSame | The ip prefixes %s are illegal which mask must be same. | The IP address prefix masks are not the same. |
403 | InvalidIp.IpPrefixMustInReserveSegment | The ip prefix must in vswitch reserve segment. | The IP address prefix is invalid and is not in the reserved CIDR block of the vSwitch. |
403 | InvalidIp.IpPrefixNotAvailable | The ip prefix is/are not available. | The IP address prefix is not available. |
403 | InvalidIp.IpPrefixNotStrict | The ip prefix must be strict cidr format. | The IP address prefix is invalid and is not in the CIDR format. |
403 | InvalidVSwitchId.IpPrefixNotEnough | The specified vSwitch has not enough ip prefix. | The number of IP address prefixes in the specified vSwitch is insufficient. |
403 | MissingParameter | These parameters %s cannot be both empty. | A required parameter is not specified. The required parameters cannot be empty. |
404 | InvalidEniId.NotFound | %s | The specified ENI ID does not exist. |
404 | MaxEniIpv6IpsCountExceeded | The ipv6 address count exceed limitation. | - |
404 | InvalidOperation.VSwitchIpv6Disabled | The specified VSwitch does not support Ipv6 feature. | The specified VSwitch does not support IPv6. |
404 | InvalidOperation.EnableIpv6Failed | The specified VSwitch does not support Ipv6 feature. | - |
404 | InvalidIp.IpAssigned | The specified ipv6 has already been allocated. | - |
404 | InvalidVSwitchId.IpInvalid | The specified ipv6 does not match VSwitch cidr scope. | - |
404 | InvalidOperation.HasIpv6RouteEntry | The specified eni has been pointed to the next hop of the route. | - |
404 | InvalidOperation.VSwitchCidrReservationNotExist | The specified vSwitch has no cidr reservation. | - |
500 | InvalidOperation.RegionNotSupportIpPrefix | The 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 time | Summary of changes | Operation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-04-26 | The Error code has changed | see changesets | ||||||||||
| ||||||||||||
2021-07-05 | The Error code has changed. The response structure of the API has changed | see changesets | ||||||||||
|