Assigns one or more IPv6 addresses to an elastic network interface (ENI).
Usage notes
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. Take note of the following items:
- IPv6 must be enabled for the vSwitch to which the ENI is connected. 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 Elastic Compute Service (ECS) 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 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 Instance families.
- After the operation is called, you can obtain the IPv6 addresses assigned to the ENI from the response.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AssignIpv6Addresses | The operation that you want to perform. Set the value to AssignIpv6Addresses. |
RegionId | String | Yes | cn-hangzhou | The region ID of the ENI. You can call the DescribeRegions operation to query the most recent region list. |
NetworkInterfaceId | String | Yes | eni-bp1iqejowblx6h8j**** | The ENI ID. |
Ipv6AddressCount | Integer | No | 1 | The number of IPv6 addresses to generate at random for the ENI. Valid values: 1 to 10. Note You must specify Ipv6Addresses.N or Ipv6AddressCount but not both. |
Ipv6Address.N | String | No | 2001:db8:1234:1a00::**** | IPv6 address N to assign to the ENI. Valid values of N: 1 to 10. Example: Ipv6Address.1=2001:db8:1234:1a00::**** Note You must specify Ipv6Addresses.N or Ipv6AddressCount but not both. |
Ipv6Prefix.N | String | No | 2001:db8:1234:1a00:****::/80 | IPv6 prefix N to assign to the ENI. Valid values of N: 1 to 10. Note To assign IPv6 prefixes to the ENI, you must specify Ipv6Prefix.N or Ipv6PrefixCount but not both. |
Ipv6PrefixCount | Integer | No | 1 | The number of IPv6 prefixes to assign to the ENI. Valid values: 1 to 10. Note To assign IPv6 prefixes to the ENI, you must specify Ipv6Prefix.N or Ipv6PrefixCount but not both. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-426655440000 | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | The request ID. |
NetworkInterfaceId | String | eni-bp1iqejowblx6h8j**** | The ENI ID. |
Ipv6Sets | Array of String | 2001:db8:1234:1a00::**** | The IPv6 addresses assigned to the ENI. |
Ipv6PrefixSets | Array of String | 2001:db8:1234:1a00:****::/80 | The IPv6 prefixes assigned to the ENI. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=AssignIpv6Addresses
&NetworkInterfaceId=eni-bp1iqejowblx6h8j****
&RegionId=cn-hangzhou
&Ipv6Address.1=2001:db8:1234:1a00::****
&Ipv6Address.2=2001:db8:1234:1a01::****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<AssignIpv6AddressesResponse>
<Ipv6Sets>
<Ipv6Address>2001:db8:1234:1a00::****</Ipv6Address>
<Ipv6Address>2001:db8:1234:1a01::****</Ipv6Address>
</Ipv6Sets>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<NetworkInterfaceId>eni-bp1iqejowblx6h8j****</NetworkInterfaceId>
</AssignIpv6AddressesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Ipv6Sets" : {
"Ipv6Address" : [ "2001:db8:1234:1a00::****", "2001:db8:1234:1a01::****" ]
},
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"NetworkInterfaceId" : "eni-bp1iqejowblx6h8j****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | UnsupportedParameter | %s | A specified parameter is not supported. |
400 | InvalidParameter | %s | Invalid parameter value. |
400 | InvalidInstanceID.Malformed | %s | Invalid InstanceId format. |
400 | MissingParameter | %s | A required parameter is not specified. |
400 | InvalidParams.EniId | %s | Invalid NetworkInterfaceId value. |
400 | InvalidOperation.InvalidEcsState | %s | This operation cannot be performed on the instance in the current state. |
400 | InvalidOperation.InvalidEniState | %s | This operation cannot be performed on the ENI in the current state. |
400 | InvalidPrivateIpAddress.Duplicated | Specified private IP address is duplicated. | The specified private IP address is already in use. Try a different IP address. |
400 | IncorrectVSwitchStatus | The current status of vSwitch does not support this operation. | This operation cannot be performed on the vSwitch in the current state. |
400 | InvalidParameter.Conflict | %s | Invalid parameter value. 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 is not found, or your AccessKey pair expired. |
403 | Forbedden.NotSupportRAM | %s | Resource Access Management (RAM) users do not have the required permissions 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 | The operation is not supported while the ENI is of the current type. |
403 | MaxEniIpv6IpsCountExceeded | %s | The maximum number of IPv6 addresses that can be assigned to the ENI is exceeded. |
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 | InvalidOperation.Ipv4CountExceeded | %s | The maximum number of IPv4 addresses is exceeded. |
403 | InvalidOperation.Ipv6CountExceeded | %s | The maximum number of IPv6 addresses is exceeded. |
403 | InvalidOperation.Ipv6NotSupport | %s | IPv6 addresses do not support the operation. |
403 | InvalidVSwitch.Ipv6NotTurnOn | %s | The IPv6 feature is not enabled for your current vSwitch. Enable the feature and try again. |
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 | The maximum number of instances in the specified security group is exceeded. |
403 | InvalidIp.IpPrefixIllegal | The ip prefixes %s is/are illegal. | The IP prefix is invalid and is not in the CIDR format. |
403 | InvalidIp.IpPrefixMaskIllegal | The ip prefix mask is illegal. | The IP prefix mask is invalid. |
403 | InvalidIp.IpPrefixMaskInvalid | The ip prefixes mask %s is illegal which must be between %s and %s. | The IP 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 prefix masks are not the same. |
403 | InvalidIp.IpPrefixMustInReserveSegment | The ip prefix must in vswitch reserve segment. | The IP 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 prefix is not available. |
403 | InvalidIp.IpPrefixNotStrict | The ip prefix must be strict cidr format. | The IP 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 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 is not found. |
500 | InvalidOperation.RegionNotSupportIpPrefix | The current region does not support ip prefix. | You cannot assign IP prefixes in this region. |
For a list of error codes, see Service error codes.