Help Center> Elastic IP > Best Practices> On-premises Data Centers Providing Internet-Accessible Services Using IPv6 EIPs
Updated on 2022-12-09 GMT+08:00

On-premises Data Centers Providing Internet-Accessible Services Using IPv6 EIPs

Application Scenarios

You can use the IPv6 function of the EIP service to map existing IPv4 EIPs into IPv6 EIPs. After the IPv6 EIP function is enabled, you will obtain both an IPv4 EIP and its corresponding IPv6 EIP. External IPv6 addresses can access cloud resources through this IPv6 EIP.

If existing services in an on-premises data center (IDC) cannot be migrated to the cloud because they use IPv4 addresses and also the IPv4/IPv6 dual-stack reconstruction cannot be completed for these services in a short period, IPv6 EIPs can be used to connect to the on-premises data center. Then, the data center can provide internet-accessible services using IPv6 EIPs without the need to reconstruct the existing IPv4 network.

Architecture

  1. A virtual private network (VPN) connects an on-premises data center to a VPC.
  2. A NAT gateway in the VPC uses an IPv6 EIP to provide internet-accessible services.
  • IPv6 EIP can only be used to provide internet-accessible services and cannot access IPv6 addresses.
  • The CIDR block of an on-premises data center cannot overlap with the CIDR block of the VPC subnet. Otherwise, the communication between them will fail.
Figure 1 Networking diagram

Advantages

On-premises data centers can provide internet-accessible services using IPv6 EIPs without the need to reconstruct their existing IPv4 networks, meeting different requirements of IPv4 and IPv6 users.

Notes and Constraints

After IPv6 EIP is enabled, inbound and outbound security group rules need to be added to allow packets to and from the IP address range 198.19.0.0/16. IPv6 EIP uses NAT64 to convert the source IPv6 address in the inbound direction to an IPv4 address in the IP address range 198.19.0.0/16. The source port can be a random one, the destination IP address is the private IPv4 address of your local server, and the destination port remains unchanged.

Table 1 Security group rules

Direction

Protocol

Source and Destination

Inbound

All

Source: 198.19.0.0/16

Outbound

All

Destination: 198.19.0.0/16

Resource Planning

Table 2 Resources

Resource

Resource Name

Description

Quantity

VPC

VPC-Test01

This VPC (192.168.0.0/24) will have an EIP and a NAT gateway deployed.

1

EIP

EIP-IPv4&IPv6

When you create this IPv4 EIP, enable the IPv6 EIP function.

1

NAT gateway

NAT-Test

This public NAT gateway will have an EIP bound.

1

VPN gateway

VPN-GW-Test

This VPN gateway is an egress gateway in a VPC and allows reliable and encrypted communications between a VPC and an on-premises data center.

1

VPN connection

VPN-Test

This VPN connection quickly builds a reliable and encrypted communications channel between a VPN gateway and a remote gateway.

1

On-premises data center

IDC-Test

This on-premises data center (192.168.1.0/24) includes remote gateways, routers, and backend servers.

1

Operation Process

  1. 1
  2. 2
  3. 3

Procedure

  1. Buy an EIP and enable the IPv6 EIP function.

    Buy an EIP with the required bandwidth and select the IPv6 EIP option.

    For details, see Assigning an EIP.

  2. Configure a VPN.

    A VPN consists of a VPN gateway and one or more VPN connections. A VPN gateway provides an internet egress for a VPC and works together with the gateway in the on-premises data center.

    1. Create a VPC.

      Set the VPC CIDR block to 192.168.0.0/24. The CIDR block of the on-premises data center is 192.168.1.0/24.

      The CIDR block of an on-premises data center cannot overlap with the CIDR block of the VPC subnet. Otherwise, the communication between them will fail.

      For details, see Creating a VPC.

    2. Create a VPN gateway.

      VPC: Select the VPC created in 2.a.

      Bandwidth: Select the bandwidth based on your service requirements.

      For details, see Creating a VPN Gateway.

    3. Create a VPN connection.

      Local Subnet: Select subnets or manually enter CIDR blocks, for example, 192.168.0.0/24,198.19.0.0/16.

      Remote Gateway: Set it to public IP address of the gateway in the data center.

      Remote Subnet: Set it to the CIDR block 192.168.1.0/24 of the data center.

      For details, see Creating a VPN Connection.

      After the IPv6 EIP function is enabled, the source IP address will be translated into one in the IP address range 198.19.0.0/16. Therefore, you need to enter the VPC subnet and then the IP address range 198.19.0.0/16 in sequence in the Local Subnet area.

    4. Configure the VPN device in the data center.

      After configuring the VPN on the cloud, you need to configure the VPN device in the data center. For details, see Virtual Private Network Administrator Guide.

  3. Configure a public NAT gateway.

    After purchasing a public NAT gateway, you can add DNAT rules to enable your servers in the VPC or servers in your data center that are connected to the VPC to provide internet-accessible services.

    1. Buy a public NAT gateway.

      VPC: Select the VPC created in 2.a.

      Subnet: Select a subnet in the VPC created in 2.a.

      For details, see Buying a Public NAT Gateway.

    2. Add a DNAT rule.

      Select the EIP purchased in 1 and add a DNAT rule based on the private IP address and port of the data center. For example, you can set Port Type to Specific port, Protocol to TCP, Private IP Address to 192.168.1.22, and select the EIP to be associated.

      For details, see Adding a DNAT Rule.

Verification

After the preceding operations are complete, the IPv6 EIPs can be used to provide internet-accessible services.

You can query the IPv6 addresses on the EIPs page.

Figure 2 IPv6 addresses

Use an IPv6 client that can access the internet to test the connectivity of the IPv6 EIP.