Updated on 2024-06-27 GMT+08:00

Network and Resource Planning

To set up a hybrid cloud network using Enterprise Router, Direct Connect, and VPN and allow Direct Connect and VPN to work in an active/standby pair, you need:
  • Network Planning: Plan CIDR blocks of VPCs and their subnets, Direct Connect connection, VPN connections, enterprise router, and routes.
  • Resource Planning: Plan the quantity, names, and other parameters of cloud resources, such as VPC, Direct Connect connection, VPN connection, and enterprise router.

Network Planning

Figure 1 shows the network diagram of Direct Connect and VPN connections that work in an active/standby pair. Table 2 describes the network planning.

Figure 1 Network diagram of Direct Connect and VPN connections working in an active/standby pair
Direct Connect and VPN connections work in an active/standby pair. If the Direct Connect connection is normal, it is preferentially selected for traffic forwarding.
  • Only preferred routes are displayed in the enterprise router route table. The routes of a virtual gateway attachment have a higher priority than those of a VPN gateway attachment. Therefore, the routes of the VPN gateway attachment will not be displayed in the route table.
  • By default, the Direct Connect connection is used for communications between the VPC and on-premises data center. Table 1 shows the details about the traffic flows in this example.
Table 1 Network traffic flows

Path

Description

Request traffic: from VPC 1 to the on-premises data center

  1. In the route table of VPC 1, there is a route with the next hop set to the enterprise router to forward traffic from VPC 1 to the enterprise router.
  2. In the route table of the enterprise router, there is a route with the next hop set to the virtual gateway attachment to forward traffic from the enterprise router to the virtual gateway.
  3. The virtual gateway associated with the virtual interface forwards traffic from the virtual gateway to the connection through the remote gateway of the virtual interface.
  4. Traffic is forwarded to the on-premises data center over the connection.

Response traffic: from the on-premises data center to VPC 1

  1. Traffic is forwarded to the virtual interface over the connection.
  2. The virtual interface associated with the global DC gateway forwards traffic from the local gateway of the virtual interface to the global DC gateway.
  3. The virtual gateway forwards the traffic to the enterprise router.
  4. In the route table of the enterprise router, there is a route with the next hop set to the VPC 1 attachment to forward traffic from the enterprise router to VPC 1.
Table 2 Description of network planning for Direct Connect and VPN connections that work in active/standby mode

Cloud Service/Resource

Description

VPC

A VPC is required to run your workloads. In this example, VPC 1 is used.
  • The CIDR blocks of the VPC and of the on-premises data center cannot overlap.
  • The VPC has a default route table.
  • The routes in the default route tables are described as follows:
    • Local: a system route for communications between subnets in a VPC.
    • Enterprise router: traffic from a VPC subnet can be forwarded to the enterprise router. The route destination is set to the on-premises network CIDR block, as listed in Table 3.

There is another VPC with a subnet used by VPN.

When you create a VPN gateway, you need to specify this subnet. The CIDR block of this subnet cannot overlap with that of any existing subnet in the VPC.

Direct Connect

  • One connection links your on-premises data center to the cloud.
  • One virtual gateway is attached to the enterprise router.
  • One virtual interface connects the virtual gateway with the connection.

VPN

  • One VPN gateway is attached to the enterprise router.
  • One customer gateway is used to connect to the on-premises data center.
  • Two VPN connections connect the VPN gateway and the customer gateway and work in an active/standby pair.

Enterprise router

After Default Route Table Association and Default Route Table Propagation are enabled and an attachment is created, Enterprise Router will automatically:
  • VPC
    • Associate the service VPC attachment with the default route table of the enterprise router.
    • Propagate the service VPC attachment to the default route table of the enterprise router. The route table automatically learns the VPC CIDR block as the destination of the route. For details, see Table 4.
  • Direct Connect
    • Associate the virtual gateway attachment with the default route table of the enterprise router.
    • Propagate the virtual gateway attachment to the default route table of the enterprise router to learn the routes of Direct Connect. For details, see Table 4.
  • VPN
    • Associate the VPN gateway attachment with the default route table of the enterprise router.
    • Propagate the VPN gateway attachment to the default route table of the enterprise router to learn the routes of VPN. For details, see Table 4.

ECS

An ECS is deployed in the VPC to verify communications between the cloud and the on-premises data center.

If you have multiple ECSs associated with different security groups, you need to add rules to the security groups to allow network access.

Table 3 VPC route table

Destination

Next Hop

Route Type

192.168.3.0/24

Enterprise router

Static route (custom)

  • If you enable Auto Add Routes when creating a VPC attachment, you do not need to manually add static routes to the VPC route table. Instead, the system automatically adds routes (with this enterprise router as the next hop and 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 as the destinations) to all route tables of the VPC.
  • If an existing route in the VPC route tables has a destination to 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16, the routes will fail to be added. In this case, do not enable Auto Add Routes. After the attachment is created, manually add routes.
  • You need to add a route to the VPC route table with the destination set to the on-premises network CIDR block and next hop set to enterprise router.
Table 4 Enterprise router route table

Destination

Next Hop

Route Type

VPC 1 CIDR block: 172.16.0.0/16

VPC 1 attachment: er-attach-01

Propagated

On-premises network CIDR block: 192.168.3.0/24

Virtual gateway attachment: vgw-demo

Propagated

On-premises network CIDR block: 192.168.3.0/24

VPN gateway attachment: vpngw-demo

Propagated

  • Only preferred routes are displayed in the enterprise router route table. If both the Direct Connect and VPN connections are working normally, the routes of the virtual gateway attachment take priority and can be viewed in the enterprise router route table. All routes of the VPN gateway attachment cannot be viewed.
  • When the Direct Connect connection becomes faulty and the active VPN connection automatically takes over, you can view the propagated routes of the VPN gateway attachment in the enterprise router route table on the management console.

Resource Planning

An enterprise router, a Direct Connect connection, VPN resources, two VPCs, and an ECS are in the same region but can be in different AZs.

The following resource details are only examples. You can modify them if needed.

Table 5 Details of required resources

Resource

Quantity

Description

VPC

2

A VPC is required to run your workloads and needs to be attached to the enterprise router.
  • VPC name: Set it based on site requirements. In this example, vpc-for-er is used.
  • VPC IPv4 CIDR block: The CIDR block must be different from that of the on-premises data center. Set it based on site requirements. In this example, 172.16.0.0/16 is used.
  • Subnet name: Set it based on site requirements. In this example, subnet-for-er is used.
  • Subnet IPv4 CIDR block: The CIDR block must be different from the on-premises network CIDR block. Set it based on site requirements. In this example, 172.16.0.0/24 is used.

A VPC is required, with a subnet for deploying the VPN gateway.

  • VPC name: Set it based on site requirements. In this example, vpc-for-vpn is used.
  • VPC IPv4 CIDR block: Set it based on site requirements. In this example, set it to 10.0.0.0/16.
  • Subnet name: A default subnet is created together with the VPC. Set the subnet name based on site requirements. In this example, subnet-01 is used.
  • Subnet IPv4 CIDR block: Set it based on site requirements. In this example, set it to 10.0.0.0/24.
NOTICE:

When you create a VPN gateway, you need to select this VPC and set Interconnection Subnet to a subnet that is not used by any resource and whose CIDR block does not overlap with existing subnet CIDR blocks in the VPC. In this example, the CIDR block of the interconnection subnet cannot be the same as that of the default subnet subnet-01.

Enterprise router

1

  • Name: Set it based on site requirements. In this example, er-test-01 is used.
  • ASN: Set a different ASN from that of the on-premises data center. In this example, retain the default value 64512.
  • Default Route Table Association: Enable
  • Default Route Table Propagation: Enable
  • Auto Accept Shared Attachments: Set it based on site requirements. In this example, this option is enabled.
  • Three attachments on the enterprise router:
    • VPC attachment: er-attach-VPC
    • Virtual gateway attachment: er-attach-VGW
    • VPN gateway attachment: er-attach-VPN

Direct Connect

1

One connection is required.

Virtual gateway
  • Name: Set it based on site requirements. In this example, vgw-demo is used.
  • Associate With: Select Enterprise Router.
  • Enterprise Router: Select your enterprise router. In this example, er-test-01 is used.
  • BGP ASN: The ASN is the same as or different from that of the enterprise router. In this example, retain the default value 64512.
Virtual interface
  • Name: Set it based on site requirements. In this example, vif-demo is used.
  • Virtual Gateway: Select your virtual gateway. In this example, vgw-demo is used.
  • Local Gateway: Set it based on site requirements. In this example, 10.0.0.1/30 is used.
  • Remote Gateway: Set it based on site requirements. In this example, 10.0.0.2/30 is used.
  • Remote Subnet: Set it based on site requirements. In this example, 192.168.3.0/24 is used.
  • Routing Mode: Select BGP.
  • BGP ASN: ASN of the on-premises data center, which must be different from the ASN of the virtual gateway on the cloud. In this example, 65525 is used.

VPN

1

VPN gateway
  • Name: Set it based on site requirements. In this example, vpngw-demo is used.
  • Associate With: Select Enterprise Router.
  • Enterprise Router: Select your enterprise router. In this example, er-test-01 is used.
  • BGP ASN: The ASN must be the same as that of the virtual gateway because the Direct Connect and VPN connections back up each other. In this example, 64512 is used.
  • VPC: Select the VPC. In this example, select vpc-for-vpn.
  • Interconnection Subnet: This subnet is used by the VPN gateway. The subnet cannot overlap with existing subnets in the VPC. Set it based on site requirements. In this example, 10.0.5.0/24 is used.

Customer gateway

  • Name: Set it based on site requirements. In this example, cgw-demo is used.
  • Routing Mode: Select Dynamic (BGP).
  • BGP ASN: ASN of the on-premises data center. The ASN must be the same as that of the virtual gateway because the Direct Connect and VPN connections back up each other. In this example, 65525 is used.

Two VPN connections that work in active/standby mode:

  • Name: Set it based on site requirements. In this example, the active VPN connection is vpn-demo-01, and the standby VPN connection is vpn-demo-02.
  • VPN Gateway: Select your VPN gateway. In this example, vpngw-demo is used.
  • EIP: Set it based on site requirements. Select the active EIP for the active VPN connection and the standby EIP for the standby VPN connection.
  • VPN Type: Select Route-based.
  • Customer Gateway: Select your customer gateway. In this example, cgw-demo is used.
  • Interface IP Address Assignment: In this example, Automatically assign is selected.
  • Routing Mode: Select Dynamic (BGP).

ECS

1

  • ECS Name: Set it based on site requirements. In this example, ecs-demo is used.
  • Image: Select an image based on site requirements. In this example, a public image (CentOS 8.2 64bit) is used.
  • Network
    • VPC: Select the VPC. In this example, select vpc-for-er.
    • Subnet: Select a subnet. In this example, select subnet-for-er.
  • Security Group: Select a security group based on site requirements. In this example, the security group sg-demo uses a general-purpose web server template.
  • Private IP address: 172.16.1.137
  • The virtual gateway and the VPN gateway must use the same ASN to prevent network loops because the Direct Connect and VPN connections back up each other. In this example, 64512 is used.
  • The ASN of the enterprise router can be the same as or different from that of the virtual gateway and the VPN gateway. In this example, 64512 is used.
  • The ASN of the on-premises data center must be different from that used on the cloud. Set this ASN based on site requirements. In this example, 65525 is used.