Help Center> Cloud Container Engine> Best Practices> Networking> Allowing Containers and IDCs to Communicate with Each Other Through VPC and Direct Connect

Allowing Containers and IDCs to Communicate with Each Other Through VPC and Direct Connect

Scenario

By using VPC and Direct Connect, IP addresses in the container CIDR block (172.56.0.0/16) and IDC CIDR block (20.227.0.0/16) can communicate with each other in the VPC network model.

Figure 1 Example network topology

Prerequisites

An IDC is available, and the Direct Connect service has been applied for.

Procedure

  1. Create a Direct Connect connection.

    1. Log in to the management console, click in the upper left corner, and select the desired region and project. Click at the upper left corner and choose Network > Direct Connect in the expanded list.

    2. In the navigation pane on the left of the console, choose Direct Connect > Connections. On the displayed page, click Create Connection.

    3. On the Create Connection page, click Full Service Installation.

  2. Create a virtual gateway.

    Choose Direct Connect > Virtual Gateways, and click Create Virtual Gateway on the right. Add the VPC CIDR block and the container CIDR block in the VPC network model.
    Figure 2 Creating a virtual gateway

  3. Create a Cloud Connect connection.

    1. In the navigation pane on the left of the console, choose Cloud Connect > Cloud Connections. On the displayed page, click Create Cloud Connection.

    2. After the connection is created, click the cloud connection name to go to its details page. On the Network Instances tab page, click Load Network Instance to add VPC information.

    3. Check the VPC CIDR blocks on the Cloud Connect VPC and ensure that the VPC and container CIDR blocks have been added.

    4. Add the VGW CIDR blocks on the Direct Connect gateway.

    5. Check the VGW CIDR blocks on the Direct Connect gateway and ensure that the remote subnets are correctly added.

  4. Test the connectivity.

    1. On an IDC host, traceroute the IP address of the container node or container on the cloud to check whether the route to the cloud gateway of Direct Connect is normal.
      1. If the route is normal, Direct Connect has a return route.
      2. If the route to the cloud gateway of Direct Connect is abnormal, check whether the route settings at both ends of Direct Connect are correct.
    2. If the IP address cannot be tracerouted, try the ping or telnet operation. Before using ping, ensure that the ICMP policy has been enabled for the security group if the target is a HUAWEI CLOUD ECS.