Allocates one or more IPv6 addresses to an elastic network interface (ENI).
Operation description
Operation description
You can specify IPv6 addresses within the CIDR block of the vSwitch to which the elastic network interface (ENI) belongs, or specify the number of IPv6 addresses for automatic creation of IPv6 addresses. Note the following items:
-
The vSwitch to which the ENI belongs must have IPv6 enabled. For more information, see Enable an IPv6 CIDR block for an existing vSwitch.
-
The ENI must be in the Active or InUse state.
-
When you operate on a primary network interface controller (NIC), the instance to which the NIC is attached must be in the Running or Stopped state.
-
The number of IPv6 addresses that can be allocated to a single NIC depends on the instance type of the instance to which the NIC is attached.
-
If the ENI is in the Active state, you can allocate up to 10 IPv6 addresses to the ENI.
-
If the ENI is attached to an instance, the number of IPv6 addresses that can be allocated is limited by the instance type. For more information, see Instance families.
-
-
After you call this operation, you can obtain the allocated IPv6 address information from the response.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:AssignIpv6Addresses |
create |
*NetworkInterface
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the elastic network interface (ENI). You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| NetworkInterfaceId |
string |
Yes |
The ID of the elastic network interface (ENI). |
eni-bp1iqejowblx6h8j**** |
| Ipv6AddressCount |
integer |
No |
The number of IPv6 addresses to randomly generate for the elastic network interface (ENI). Valid values: 1 to 10. Note
When you call this operation, you must set either the |
1 |
| Ipv6Address |
array |
No |
One or more IPv6 addresses to assign to the elastic network interface (ENI). You can set up to 10 IPv6 addresses. Valid values of N: 1 to 10. Example: Ipv6Address.1=2001:db8:1234:1a00::**** Note
When you call this operation, you must set either the |
2001:db8:1234:1a00::**** |
|
string |
No |
One or more IPv6 addresses to assign to the elastic network interface (ENI). You can set up to 10 IPv6 addresses. Valid values of N: 1 to 10. Example: Ipv6Address.1=2001:db8:1234:1a00::**** Note
When you call this operation, you must set either the |
2001:db8:1234:1a00::**** |
|
| Ipv6Prefix |
array |
No |
One or more IPv6 prefixes to assign to the elastic network interface (ENI). Valid values of N: 1 to 10. Note
If you want to set IPv6 prefixes for the ENI, you must set either the Ipv6Prefix.N parameter or the Ipv6PrefixCount parameter, but not both. |
|
|
string |
No |
One or more IPv6 prefixes to assign to the elastic network interface (ENI). Valid values of N: 1 to 10. Note
If you want to set IPv6 prefixes for the ENI, you must set either the Ipv6Prefix.N parameter or the Ipv6PrefixCount parameter, but not both. |
2001:db8:1234:1a00:****::/80 |
|
| Ipv6PrefixCount |
integer |
No |
The number of IPv6 prefixes to assign to the elastic network interface (ENI). Valid values: 1 to 10. Note
If you want to set IPv6 prefixes for the ENI, you must set either the Ipv6Prefix.N parameter or the Ipv6PrefixCount parameter, but not both. |
1 |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but make sure that the token is unique among different requests. ClientToken can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
123e4567-e89b-12d3-a456-426655440000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| NetworkInterfaceId |
string |
The ID of the elastic network interface (ENI). |
eni-bp1iqejowblx6h8j**** |
| Ipv6Sets |
object |
||
| Ipv6Address |
array |
The IPv6 addresses allocated to the elastic network interface (ENI). |
|
|
string |
The IPv6 addresses allocated to the elastic network interface (ENI). |
2001:db8:1234:1a00::**** |
|
| Ipv6PrefixSets |
object |
||
| Ipv6Prefix |
array |
The IPv6 prefixes allocated to the elastic network interface (ENI). |
|
|
string |
The IPv6 prefix allocated to the elastic network interface (ENI). |
2001:db8:1234:1a00:****::/80 |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"NetworkInterfaceId": "eni-bp1iqejowblx6h8j****",
"Ipv6Sets": {
"Ipv6Address": [
"2001:db8:1234:1a00::****"
]
},
"Ipv6PrefixSets": {
"Ipv6Prefix": [
"2001:db8:1234:1a00:****::/80"
]
}
}
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 | |
| 400 | InvalidParams.EniId | %s | The specified EniId parameter is invalid. |
| 400 | InvalidOperation.InvalidEcsState | %s | This operation is not allowed in the current cloud service status. |
| 400 | InvalidOperation.InvalidEniState | %s | The current state of the network interface controller (NIC) does not allow this operation. |
| 400 | InvalidPrivateIpAddress.Duplicated | Specified private IP address is duplicated. | |
| 400 | IncorrectVSwitchStatus | The current status of vSwitch does not support this operation. | The specified vSwitch is in a pending state and cannot be deleted. |
| 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 | InvalidOperation.EniOperationConflict | The previous ENI operation is still in progress. Please try again later. | Current operation conflict, please wait for a moment and try again |
| 400 | TaskConflict | The operation is too frequent, please wait a moment and try again. | EIP operations are too frequent. |
| 400 | RangeExceede.Ipv6NotInReserved | The specified IPv6 is not in the reserved segment and this operation is not allowed. | IPv6 is not in the reserved segment. This operation is not allowed. |
| 400 | InvalidOperation.Ipv6InUse | The target IPv6 is occupied and cannot be allocated. Please replace it and try again. | The target IPv6 is occupied and cannot be allocated. Please replace it and try again. |
| 500 | InvalidOperation.RegionNotSupportIpPrefix | The current region does not support ip prefix. | You cannot assign IP address prefixes in this region. |
| 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 | MissingParameter | %s | |
| 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 | This operation is not allowed for the current NIC type. |
| 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 | The IP entered is not in the correct format or is not in the optional CIDR range. |
| 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 | IPv6 does not support the current operation. |
| 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 | |
| 403 | InvalidOperation.EniServiceManaged | %s | The operation is invalid. |
| 403 | SecurityGroupInstanceLimitExceed | %s | The maximum number of instances in the security group has been reached. |
| 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 | InvalidOperation.EniAssociateWithBindedEip | The specified eni has associate with binded eip. | The ENI is associated with an EIP in cut-through mode and cannot have IPv6 addresses assigned. |
| 404 | InvalidEniId.NotFound | %s | |
| 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. | The specified private IP address is invalid. |
| 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. | The specified vSwitch does not have available reserved CIDR blocks. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.