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

Network and Resource Planning

To use an enterprise router to isolate VPCs in the same region, you need to:
  • Network Planning: Plan CIDR blocks of VPCs and their subnets, and route tables of VPCs and the enterprise router.
  • Resource Planning: Plan the quantity, names, and other parameters of cloud resources, including VPCs, ECSs, and the enterprise router.

Network Planning

Figure 1 shows the network planning for isolating VPCs in the same region.

Figure 1 Network planning for isolating VPCs in the same region
Table 1 Network traffic flows

Path

Description

Request traffic: from VPC 1 to VPC 4

  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. VPC 1 is associated with route table 1 of the enterprise router. This route table has a route with the next hop set to VPC 4 attachment to forward traffic from the enterprise router to VPC 4.

Response traffic: from VPC 4 to VPC 1

  1. In the route table of VPC 4, there is a route with the next hop set to the enterprise router to forward traffic from VPC 4 to the enterprise router.
  2. VPC 4 is associated with route table 2 of the enterprise router. This route table has a route with the next hop set to VPC 1 attachment to forward traffic from the enterprise router to VPC 1.
Table 2 Description of network planning for isolating VPCs in the same region

Resource

Description

VPCs

  • VPC 1, VPC 2, and VPC 3 need to be isolated from each other, but all of them need to communicate with VPC 4.
  • The CIDR blocks of the VPCs to be connected cannot overlap with each other.

    In this example, the CIDR blocks of the VPCs are propagated to the enterprise router route table as the destination in routes. The CIDR blocks cannot be modified and overlapping CIDR blocks may cause route conflicts.

    If your existing VPCs have overlapping CIDR blocks, do not use propagated routes. Instead, you need to manually add static routes to the route table of the enterprise router. The destination can be VPC subnet CIDR blocks or smaller ones.

  • Each VPC has a default route table.
  • The routes in the default route table are described as follows:
    • Local: a system route for communications between subnets in a VPC.
    • Enterprise router: custom routes with 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 as the destinations for routing traffic from a VPC subnet to the enterprise router. See Table 3 for details.

Enterprise router

Disable the Default Route Table Association and Default Route Table Propagation, create two route tables, attach the four VPCs to the enterprise router, and configure the route tables as follows:
  • Associate VPC 1, VPC 2, and VPC 3 attachments with the route table 1. Propagate VPC 4 attachment to the route table 1. The route table automatically learns the VPC CIDR blocks as the destination of routes. For details, see Table 4.
  • Associate the VPC 4 attachment with the route table 2. Propagate VPC 1, VPC 2, and VPC 3 attachments to the route table 2. The route table automatically learns the VPC CIDR blocks as the destination of routes. For details, see Table 5.

ECSs

The four ECSs are in different VPCs. If the ECSs are in different security groups, add rules to the security groups to allow access to each other.

Table 3 VPC route table

Destination

Next Hop

Route Type

10.0.0.0/8

Enterprise router

Static route (custom)

172.16.0.0/12

Enterprise Router

Static route (custom)

192.168.0.0/16

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.
  • Do not set the destination of a route (with an enterprise router as the next hop) to 0.0.0.0/0 in the VPC route table. If an ECS in the VPC has an EIP bound, the VPC route table will have a policy-based route with 0.0.0.0/0 as the destination, which has a higher priority than the route with the enterprise router as the next hop. In this case, traffic is forwarded to the EIP and cannot reach the enterprise router.
Table 4 Enterprise router route table 1

Destination

Next Hop

Route Type

VPC 4 CIDR block: 192.168.0.0/16

VPC 4 attachment: er-attach-share

Propagated

Table 5 Enterprise router route table 2

Destination

Next Hop

Route Type

VPC 1 CIDR block: 10.1.0.0/16

VPC 1 attachment: er-attach-isolation-01

Propagated

VPC 2 CIDR block: 10.2.0.0/16

VPC 2 attachment: er-attach-isolation-02

Propagated

VPC 3 CIDR block: 10.3.0.0/16

VPC 3 attachment: er-attach-isolation-03

Propagated

Resource Planning

Each region has an enterprise router, VPCs, and ECSs. They can be in different AZs.

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

  • One enterprise router. See details in Table 6.
    Table 6 Enterprise router details

    Enterprise Router Name

    ASN

    Default Route Table Association

    Default Route Table Propagation

    Route Table

    Attachment

    er-test-01

    64512

    Disabled

    Disabled

    Two route tables:

    er-attach-isolation-01

    er-attach-isolation-02

    er-attach-isolation-03

    er-attach-share

    Table 7 Enterprise router route table 1 details

    Name

    Associated Attachment

    Propagated Attachment

    er-rtb-isolation

    er-attach-isolation-01

    er-attach-share

    er-attach-isolation-02

    er-attach-isolation-03

    Table 8 Enterprise router route table 2 details

    Name

    Associated Attachment

    Propagated Attachment

    er-rtb-share

    er-attach-share

    er-attach-isolation-01

    er-attach-isolation-02

    er-attach-isolation-03

  • Four VPCs that do not overlap with each other. See details in Table 9.
    Table 9 VPC details

    VPC

    VPC CIDR Block

    Subnet

    Subnet CIDR Block

    Association Route Table

    vpc-isolation-01

    10.1.0.0/16

    subnet-isolation-01

    10.1.0.0/24

    Default route table

    vpc-isolation-02

    10.2.0.0/16

    subnet-isolation-02

    10.2.0.0/24

    Default route table

    vpc-isolation-03

    10.3.0.0/16

    subnet-isolation-03

    10.3.0.0/24

    Default route table

    vpc-share

    192.168.0.0/16

    subnet-share

    192.168.0.0/24

    Default route table

  • Four ECSs, respectively, in four VPCs. See details in Table 10.
    Table 10 ECS details

    ECS Name

    Image

    VPC

    Subnet

    Security Group

    Private IP Address

    ecs-isolation-01

    Public image:

    CentOS 7.5 64-bit

    vpc-isolation-01

    subnet-isolation-01

    sg-demo

    (general-purpose web server)

    10.1.0.134

    ecs-isolation-02

    vpc-isolation-02

    subnet-isolation-02

    10.2.0.215

    ecs-isolation-03

    vpc-isolation-03

    subnet-isolation-03

    10.3.0.14

    ecs-share

    vpc-share

    subnet-share

    192.168.0.130