Help Center/ Virtual Private Cloud/ User Guide/ IPv4/IPv6 Dual-Stack Network
Updated on 2024-10-25 GMT+08:00

IPv4/IPv6 Dual-Stack Network

What Is an IPv4/IPv6 Dual-Stack Network?

An IPv4/IPv6 dual-stack network allows your resources, such as ECSs, to use both IPv4 and IPv6 addresses for private and public network communications. Figure 1 shows how an IPv4/IPv6 dual-stack network works.

Figure 1 An IPv4/IPv6 dual-stack network
Table 1 Steps for deploying a dual-stack network

Step

Description

1

If you enable IPv6 when adding a VPC subnet, an IPv6 CIDR block is automatically assigned to the subnet. You cannot customize the IPv6 CIDR block.

2

Subnets in the same VPC can communicate with each other by default. Network ACLs protect subnets, and security groups protect the instances in it.
  1. Subnets in different network ACLs are isolated from each other. To connect these subnets, you need to add inbound and outbound rules to allow traffic in and out of the subnets.
  2. Security groups are isolated from each other. If two instances are associated with different security groups, you need to add inbound and outbound rules to allow the instances to communicate with each other.
As shown in Figure 1, if allow rules are configured for network ACLs Fw-A and Fw-B and security groups Sg-A and Sg-B, ECS-A and ECS-B can communicate with each other:
  • Using private IPv4 addresses (192.168.0.10 and 192.168.1.20).
  • Using IPv6 addresses (2407:c080:1200:2075::a and 2407:c080:1200:1668::b).

3

To enable instances to communicate with the Internet using IPv4 addresses, you need to buy an EIP and bind it to the instance. An EIP can be bound to only one instance.

As shown in Figure 1, you can bind EIP-A to ECS-A and EIP-B to ECS-B so that ECS-A and ECS-B can communicate with the Internet.

4

To enable instances to communicate with the Internet using an IPv6 address, you need to add the IPv6 address to a shared bandwidth. You can add multiple IPv6 addresses to a shared bandwidth.

As shown in Figure 1, you can add the IPv6 addresses of ECS-A and ECS-B to a shared bandwidth so that ECS-A and ECS-B can communicate with the Internet.

Notes and Constraints

  • The IPv4/IPv6 dual-stack function is free for now, but will be billed at a later date (price yet to be determined).
  • The IPv6 function is now available for open beta test in certain regions. You can use the IPv6 function only after obtaining the OBT permission.
  • Only certain ECS flavors support IPv6 networks. You need to select such ECSs in supported regions.

    On the ECS console, click Buy ECS. On the displayed page, check the ECS specifications. If Yes is shown in the IPv6 column, the ECS with this specification supports IPv6.

IPv4/IPv6 Dual-Stack Application Scenarios

If your ECS supports IPv6, you can build an IPv4/IPv6 dual-stack network. Table 2 shows where IPv4/IPv6 dual-stack networks can be used.
Table 2 Application scenarios of IPv4/IPv6 dual-stack networks

Application Scenario

Scenario

Subnet

ECS

Private communication using IPv6 addresses

Your applications deployed on ECSs need to communicate with other systems (such as databases) through private networks using IPv6 addresses.

  • IPv4 CIDR block
  • IPv6 CIDR block
  • Private IPv4 address: used for private communication
  • IPv6 address: used for private communication.

Public communication using IPv6 addresses

Your applications deployed on ECSs need to provide services accessible from the Internet using IPv6 addresses.

  • IPv4 CIDR block
  • IPv6 CIDR block
  • Private IPv4 address + IPv4 EIP: used for public network communication
  • IPv6 address + shared bandwidth: used for public network communication

Your applications deployed on ECSs need to both provide services accessible from the Internet and analyze the access request data using IPv6 addresses.

If your ECS flavor does not support IPv6 addresses, you can enable the IPv6 EIP function to allow communications using IPv6 addresses. For details, see Table 3.
Table 3 Application scenarios of IPv6 EIPs

Application Scenario

Description

Subnet

ECS

Public communication using IPv6 addresses

Your applications deployed on ECSs need to provide services accessible from the Internet using IPv6 addresses.

IPv4 CIDR block

  • Private IPv4 address
  • IPv4 EIP (with IPv6 function enabled): used for public communication using IPv4 and IPv6 EIPs
Figure 2 Application scenarios of IPv6 networks

Operation Guide on IPv6 Networks

Operations on an IPv6 network are similar to those on an IPv4 network. Only some functions are configured in a different way. Table 4 describes how you can build and use an IPv6 network.

Table 4 Operation guide on IPv6 networks

Scenario

Description

Reference

Creating an IPv6 subnet

Select Enable for IPv6 CIDR Block when creating a subnet. An IPv6 CIDR block will be automatically assigned to the subnet.
  • You cannot customize an IPv6 CIDR block.
  • IPv6 cannot be disabled after the subnet is created.
  • You can enable IPv6 for existing subnets.

Creating a Subnet for an Existing VPC

Viewing in-use IPv6 addresses

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

Viewing IP Addresses in a Subnet

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.

Adding a Security Group Rule

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.

Adding a Network ACL Rule

Purchasing an EIP (IPv6)

When purchasing an EIP, select Enable IPv6 Internet access, or choose More > Enable IPv6 EIP in the Operation column of an existing IPv4 EIP. After IPv6 EIP is enabled, both IPv4 and IPv6 EIPs are assigned.

IPv6 EIP

Adding an IPv6 EIP or IPv6 address to a shared bandwidth

After purchasing a shared bandwidth, you can add IPv6 EIPs or IPv6 addresses to it.

Adding EIPs to a Shared Bandwidth

Adding an IPv6 route to the VPC route table

Add a route with Destination and Next Hop set to an IPv4 or IPv6 CIDR block.

  • 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. They must also have IPv6 addresses.

Adding Routes to a Route Table

Assigning a virtual IPv6 address

If IPv6 is enabled for a VPC subnet, you can set IP Address Type to IPv6 when assigning for a virtual IP address.

Assigning a Virtual IP Address