Updated on 2024-04-11 GMT+08:00

IPv4 and IPv6 Dual-Stack Network

What Is an IPv4 and IPv6 Dual-Stack Network?

An IPv4 and 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 and IPv6 dual-stack network works.

Figure 1 An IPv4 and 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.

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 2 describes how you can build and use an IPv6 network.

Table 2 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 the 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

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 a Custom Route

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