Help Center> Virtual Private Cloud> User Guide> VPC and Subnet> IPv4 and IPv6 Dual-Stack Network

IPv4 and IPv6 Dual-Stack Network

Overview

IPv4 and IPv6 dual-stack allows your resources, such as ECSs, to use both IPv4 and IPv6 addresses for private and public network communication.

  • Private IPv4 addresses can be used for private network access between ECSs.
  • Private IPv4 addresses with EIPs bound can be used for Internet access.
  • IPv6 addresses can be used for private network access between ECSs (in the same VPC) that have both IPv4 and IPv6 addresses.
  • IPv6 addresses can be used to access IPv6 networks on the Internet.

Application Scenarios

If your application needs to provide services for users who use IPv6 clients, you can use IPv6 EIPs or the IPv4 and IPv6 dual-stack function.

If your application needs to both provide services for users who use IPv6 clients and analyze the access request data, you can only use the IPv4 and IPv6 dual-stack function.

If private network communication is required between your application systems or between your application system and another system (such as a database system), you can only use the IPv4 and IPv6 dual-stack function.

Basic Operations

  • The basic operations for IPv4 and IPv6 dual-stack networks are the same as those for IPv4 networks. Only some parameters are different. You can check the console pages for details.
  • The IPv4/IPv6 dual-stack function is currently free, but will be billed at a later date (price yet to be determined).
  • You can experience the IPv4/IPv6 dual-stack networks only when you select ECSs configured with specific flavors in the following regions.
    • SN3 ECSs in AZ2 of region CN North-Beijng4
    • C3 and M3 ECSs in AZ1 of region CN East-Shanghai1, and C3 ECSs in AZ2 of region CN East-Shanghai1

Creating an IPv6 Subnet

Create an IPv6 subnet by following the instructions provided in Creating a Subnet for the VPC. You must ensure that Enable is selected for IPv6 CIDR Block. An IPv6 CIDR block will be automatically assigned to the subnet. The IPv6 function cannot be disabled after the subnet is created. Currently, customizing IPv6 CIDR block is not supported.

Figure 1 Creating an IPv6 subnet

Viewing In-Use IPv6 Addresses

In the subnet list, click the target subnet name. On the displayed page, view in-use IPv6 addresses on the In-Use IP Addresses tab.

Adding a Security Group Rule (IPv6)

Add a security group rule with Type set to IPv6 and Source or Destination set to an IPv6 address or IPv6 CIDR block.

Figure 2 Adding a security group rule (IPv6)

Adding a Network ACL Rule (IPv6)

Add a network ACL rule with Type set to IPv6 and Source or Destination set to an IPv6 address or IPv6 CIDR block.

Figure 3 Adding a network ACL rule (IPv6)

Purchasing an EIP (IPv6)

You can purchase an IPv6 EIP or convert an IPv4 EIP into an IPv6 EIP. For details, see IPv6 EIP.

Adding an IPv6 EIP or Dual-Stack NIC IPv6 Address to a Shared Bandwidth

Add an IPv6 EIP or dual-stack NIC IPv6 address to a shared bandwidth by following the instructions provided in Adding EIPs to a Shared Bandwidth.

Figure 4 Adding a dual-stack NIC IPv6 address to a shared bandwidth

Adding a Route (IPv6)

Add a route with Destination set to an IPv6 address and Next Hop set to an IPv6 address or CIDR block. For details about how to add a route, see Adding a Custom Route. If the destination is an IPv6 CIDR block, the next hop can only be an IP address in the same VPC as the IPv6 CIDR block.

If the destination is an IPv6 CIDR block, the next hop type can only be ECS, extension NIC, or virtual IP address. The next hop must also have IPv6 addresses.

Figure 5 Add Route

Assigning an IPv6 Virtual IP Address

Assign a virtual IPv4 or IPv6 address by referring to Assigning a Virtual IP Address.

Currently, this function is supported only in the CN East-Shanghai1 region.

Figure 6 Assigning a Virtual IP Address

Each virtual IPv6 address can only be bound to one NIC (dual-stack NIC). You can call APIs to perform switchover between active and standby ECSs. For details, see Assigning a Virtual IPv6 Address to ECSs for HA.

Dynamically Assigning IPv6 Addresses

After an ECS is created successfully, you can view the assigned IPv6 address on the ECS details page. You can also log in to the ECS and run the ifconfig command to view the assigned IPv6 address.

If an IPv6 address fails to be automatically assigned or the selected image cannot obtain an IPv6 address automatically, manually obtain the IPv6 address by referring to Dynamically Assigning IPv6 Addresses.