Help Center> Direct Connect> Best Practices> Accessing Multiple VPCs Using a Connection

Accessing Multiple VPCs Using a Connection

Overview

Your network accesses multiple VPCs through a connection. This topic uses a static routing connection as an example. For details, see Accessing a VPC over a Connection That Uses Static Routing. Assume that your data center accesses VPC-001 through 10.0.0.0/30 and accesses VPC-002 through 10.0.0.4/30.

This solution applies to standard connections that provide dedicated ports for exclusive use.

Prerequisites

  • Your on-premises network uses a single-mode fiber with a 1GE or 10GE optical module to connect to the access device in the cloud.
  • Auto-negotiation for the port must be disabled. Port speed and full-duplex mode must be manually configured.
  • 802.1Q VLAN encapsulation is supported on your network.

Typical Topology

Your on-premises network is connected to a VPC in the CN North-Beijing4 region over a single connection. For details about how to create a VPC, see the Virtual Private Cloud User Guide.

CIDR blocks used in this solution are planned as below.
Table 1 CIDR blocks

Item

CIDR Block

Your network

10.1.123.0/24

Remote and local gateways (addresses for interconnection)

10.0.0.0/30 and 10.0.0.4/30

VPC

VPC-001: 192.168.0.0/16

VPC-002: 172.16.0.0/16

Figure 1 Accessing multiple VPCs over a connection

Procedure

  1. Create a connection.

    For details, see Accessing a VPC over a Connection That Uses Static Routing.

  2. Create a virtual gateway.

    Create two virtual gateways, with one associated with VPC-001 and the other associated with VPC-002.
    Figure 2 Create Virtual Gateway
    Table 2 Virtual gateway 1 parameters

    Parameter

    Description

    Example Value

    Name

    Specifies the virtual gateway name.

    The name can contain 1 to 64 characters.

    vgw-test

    VPC

    Specifies the VPC to be associated with the virtual gateway.

    VPC-001

    Local Subnet

    Specifies the CIDR blocks of the VPC to be accessed.

    You can add one or more CIDR blocks. Separate every entry with a comma (,) if there are multiple CIDR blocks.

    192.168.0.0/16

    Description

    Provides supplementary information about the virtual gateway.

    N/A

    Figure 3 Create Virtual Gateway
    Table 3 Virtual gateway 2 parameters

    Parameter

    Description

    Example Value

    Name

    Specifies the virtual gateway name.

    The name can contain 1 to 64 characters.

    vgw-c413

    VPC

    Specifies the VPC to be associated with the virtual gateway.

    VPC-002

    Local Subnet

    Specifies the CIDR blocks of the VPC to be accessed.

    You can add one or more CIDR blocks. Separate every entry with a comma (,) if there are multiple CIDR blocks.

    172.16.0.0/16

    Description

    Provides supplementary information about the virtual gateway.

    N/A

  3. Create a virtual interface.

    Create two virtual interfaces, with each connected to a virtual gateway.
    Figure 4 Create Virtual Interface
    Table 4 Virtual interface 1 parameters

    Parameter

    Description

    Example Value

    Region

    Specifies the region where the connection resides. You can also change the region in the upper left corner of the console.

    CN North-Beijing4

    Name

    Specifies the virtual interface name.

    The name can contain 1 to 64 characters.

    vif-test

    Connection

    Specifies the connection you can use to connect your environment to HUAWEI CLOUD.

    dc-test12

    Virtual Gateway

    Specifies the virtual gateway to which the virtual interface connects.

    vgw-test

    VLAN

    Specifies the ID of the VLAN in which the virtual interface works.

    You need to configure the VLAN if you create a connection through self-service.

    The VLAN of the virtual interface of the hosting private line uses the VLAN allocated by the carrier or partner for the hosting private line. You do not need to configure the VLAN.

    30

    Bandwidth

    Specifies the bandwidth that can be used by the virtual interface in the unit of Mbit/s. The bandwidth cannot exceed that of the connection.

    500 Mbit/s

    Local Gateway

    Specifies the IP address used to connect HUAWEI CLOUD to a connection.

    10.0.0.1/30

    Remote Gateway

    Specifies the IP address for connecting to your network.

    The remote gateway must be in the same IP address range as the local gateway. Generally, a subnet with a 30-bit mask is recommended.

    10.0.0.2/30

    Remote Subnet

    Specifies the subnets and masks of your network. If there are multiple subnets, use commas (,) to separate them.

    10.1.123.0/24

    Routing Mode

    Specifies the routing mode. Two options are available, static routing and BGP routing.

    If there are two connections or you want to have another connection in the future, select BGP routing.

    Static

    BGP ASN

    Specifies the ASN of the BGP peer.

    This parameter is required when BGP routing is selected.

    N/A

    BGP MD5 Authentication Key

    Specifies the password used to authenticate the BGP peer using MD5.

    This parameter is required when BGP routing is selected.

    N/A

    Description

    Provides supplementary information about the virtual interface.

    N/A

    Figure 5 Create Virtual Interface
    Table 5 Virtual interface 2 parameters

    Parameter

    Description

    Example Value

    Region

    Specifies the region where the connection resides. You can also change the region in the upper left corner of the console.

    CN North-Beijing4

    Name

    Specifies the virtual interface name.

    The name can contain 1 to 64 characters.

    vif-c413

    Connection

    Specifies the connection you can use to connect your environment to HUAWEI CLOUD.

    dc-test12

    Virtual Gateway

    Specifies the virtual gateway to which the virtual interface connects.

    vgw-c413

    VLAN

    Specifies the ID of the VLAN in which the virtual interface works.

    You need to configure the VLAN if you create a connection through self-service.

    The VLAN of the virtual interface of the hosting private line uses the VLAN allocated by the carrier or partner for the hosting private line. You do not need to configure the VLAN.

    31

    Bandwidth

    Specifies the bandwidth that can be used by the virtual interface in the unit of Mbit/s. The bandwidth cannot exceed that of the connection.

    500 Mbit/s

    Local Gateway

    Specifies the IP address used to connect HUAWEI CLOUD to a connection.

    10.0.0.5/30

    Remote Gateway

    Specifies the IP address for connecting to your network.

    The remote gateway must be in the same IP address range as the local gateway. Generally, a subnet with a 30-bit mask is recommended.

    10.0.0.6/30

    Remote Subnet

    Specifies the subnets and masks of your network. If there are multiple subnets, use commas (,) to separate them.

    10.1.123.0/24

    Routing Mode

    Specifies the routing mode. Two options are available, static routing and BGP routing.

    If there are two connections or you want to have another connection in the future, select BGP routing.

    Static

    BGP ASN

    Specifies the ASN of the BGP peer.

    This parameter is required when BGP routing is selected.

    N/A

    BGP MD5 Authentication Key

    Specifies the password used to authenticate the BGP peer using MD5.

    This parameter is required when BGP routing is selected.

    N/A

    Description

    Provides supplementary information about the virtual interface.

    N/A

  4. Wait for route advertisement on the cloud.

    The Direct Connect device automatically advertises the routes after network connectivity is established.

  5. Advertise the routes on your device.

    Example configuration (on a Huawei device):

    ip route-static 192.168.0.0 255.255.0.0 10.0.0.1
    ip route-static 172.16.0.0 255.255.0.0 10.0.0.5