Help Center> Virtual Private Network> Best Practices> Setting Up a Cross-Border Network Using VPN and CC

Setting Up a Cross-Border Network Using VPN and CC

Scenarios

Your on-premises data center in Thailand (10.0.1.0/24) needs to communicate with your business system deployed in the VPC (10.0.3.0/24) in the HUAWEI CLOUD CN South-Guangzhou region. VPN may not be a good choice since it crosses borders and may be unstable.

Figure 1 Cross-border VPN connection

In this scenario, use Cloud Connect (CC) and VPN to ensure more stable communication. Use VPN to connect your on-premises data center to a HUAWEI CLOUD VPC nearest to your data center, for example, the VPC (10.0.2.0/24) in the AP-Hong Kong region. Then create a cloud connection to connect the VPC (10.0.2.0/24) in the AP-Hong Kong region to the VPC (10.0.3.0/24) in the CN South-Guangzhou region. Figure 2 shows the data center and regions connected by a VPN and a cloud connection, respectively.

Figure 2 Data center and regions connected by a VPN and a cloud connection

Procedure

  1. Configure a VPN in the AP-Hong Kong region.
    1. Click in the upper left corner and select the CN-Hong Kong region.
    2. Click Service List in the upper left corner. Under Networking, select Virtual Private Network.
    3. On the Virtual Private Network console, click Buy VPN Gateway.
    4. Configure the parameters based on Table 1 and click Next.
      Table 1 VPN parameters

      Parameter

      Description

      Example Value

      Billing Mode

      VPNs are billed on a pay-per-use basis.

      Pay-per-use

      Region

      A region is a geographical area where you can run your VPN service. Each region comprises one or more AZs and is completely isolated from other regions. AZs within the same region can communicate with one another through a private network, while those in different regions cannot.

      Set it to CN-Hong Kong.

      CN-Hong Kong

      Name

      VPN name.

      vpn-001

      VPC

      The name of the VPC that the VPN accesses to.

      Select a VPC created in the AP-Hong-Kong region.

      vpc-001

      Local Subnet

      The VPC subnets that will access your on-premises network through a VPN

      Select Specify CIDR Block and enter the subnets in the AP-Hong Kong and CN South-Guangzhou regions to ensure that traffic from the CN South-Guangzhou region can pass the VPN tunnel.

      Enter 10.0.2.0/24 and 10.0.3.0/24.

      10.0.2.0/24,

      10.0.3.0/24

      Remote Gateway

      The VPN gateway address in the on-premises data center

      Set this parameter to the VPN gateway address in the data center in Thailand.

      N/A

      Remote Subnet

      The subnets of your on-premises network that will access a VPC through a VPN

      Enter 10.0.1.0/24.

      10.0.1.0/24

      PSK

      The pre-shared key, which is a private key shared by two ends of a VPN connection. The PSK configurations for both ends of a VPN connection must be the same. This key is used for VPN connection negotiation.

      The PSK

      • Must contain 6 to 128 characters.
      • Can contain only:
        • Digits
        • Letters
        • Special characters: ~`!@#$%^()-_+=[]{}|\,./:;

      Test@123

      Confirm PSK

      Enter the pre-shared key again.

      Test@123

      Advanced Settings

      • Default: Use default IKE and IPsec policies.
      • Custom: including IKE Policy and IPsec Policy, which specifies the encryption and authentication algorithms of a VPN tunnel.

      Custom

  2. Configure the VPN gateway in your on-premises data center. (User VPN gateway in the Thailand data center)

    Configure the VPN based on the VPN gateway device used in your on-premises data center.

    Configure the ACL referenced by the IPsec policy as follows:

    • Source: 10.0.1.0/24
    • Destination: 10.0.2.0/24 and 10.0.3.0/24
  3. Buy a cloud connection in the Cloud Connect service. For details, see Step 2: Create a Cloud Connection.
  4. Load network instances.
    Add the VPCs in the Hong Kong and South China regions to the cloud connection.
    • Table 2 lists the parameters required to load the VPC in the Hong Kong region to the cloud connection.
    • When loading the VPC in the South China region, you only need to specify subnet 10.0.3.0/24.
    Table 2 Parameters for loading the VPC

    Parameter

    Description

    Example Value

    Account

    Whether the VPC is from your account or the other user's account.

    Current account

    Region

    The region where the VPC you want to load the cloud connection is located.

    CN-Hong Kong

    Instance Type

    The type of the instance you want to load to the cloud connection.

    VPC

    VPC

    Name of the VPC that you want to load to the cloud connection.

    Select the VPC created in 1.d.

    vpc-001

    VPC CIDR Block

    CIDR block of the VPC that you want to load to the cloud connection.

    Because you have set Instance Type to VPC, configure the following two parameters:

    • Subnet: The subnets in the VPC. Set it to the subnet whose CIDR block is 10.0.2.0/24.
    • Custom CIDR Block: Enter CIDR block 10.0.1.0/24 so that data can be transmitted to the on-premises data center over the cloud connection.

    Subnet: 10.0.2.0/24

    Custom CIDR Block: 10.0.1.0/24

    Virtual Gateway

    Name of the virtual gateway that you want to load to the cloud connection. This parameter is mandatory when Instance Type is set to Virtual gateway.

    vgw-w2

    Virtual Gateway CIDR Block

    The VPC and its CIDR block of the virtual gateway that needs to be loaded to the cloud connection. If Instance Type is set to Virtual gateway, configure the following two parameters:

    • VPC CIDR Block
    • Remote Subnet

    VPC CIDRs: 192.168.0.3/24

  5. Configure the inter-region bandwidth.

    For details, see Step 6: Configure Inter-Region Bandwidths.

  6. View route information.

    The VPC in the AP-Hong Kong region has two routes with destinations 10.0.1.0/24 and 10.0.2.0/24, respectively.

    The VPC in the south China region contains one route with destination 10.0.3.0/24.

    For details, see Viewing Route Information.

  7. Test network connectivity.

    Create an ECS in the CN South-Guangzhou region, with its private IP address set to 10.0.3.17.

    Assume that the IP address of an on-premises server is 10.0.1.17.

    Ping 10.0.3.17 from 10.0.1.17 to trigger tunnel negotiation.

    The network communication is normal if the IP address can be pinged. You can view the IPsec VPN tunnel information on the VPN gateway in the customer data center. The method for checking the IPsec VPN tunnel information varies depending on the VPN device models.