You need to enable JavaScript to run this app.
Transit Router

Transit Router

Copy page
Download PDF
Best Practices
Implementing interconnectivity and isolation between specified VPCs
Copy page
Download PDF
Implementing interconnectivity and isolation between specified VPCs
This topic describes how to configure the Transit Router (TR) to meet the networking requirements for interconnectivity and isolation between multiple Virtual Private Clouds (VPCs).​
Scenarios​
TR flexibly enables interconnectivity and isolation between multiple VPCs, whether they are in the same region or across different regions. You can implement network isolation by configuring route policies or using multiple TR route tables. This example uses a cross-region scenario to demonstrate how to use the TR to achieve interconnectivity shown in the diagram below.​
tip​
To achieve interconnectivity and isolation between multiple VPCs in the same region, first complete TR route planning by seeing Route planning, and then follow the configuration procedure described in Implementing private interconnectivity and isolation between different VPCs (same account, same region).​
​​​
Prerequisites​
  • You have created necessary VPCs and their subnets. For procedure, see Creating a VPC.​
Data planning​
Before configuration, plan the data parameters for VPCs and TRs in the diagram, as shown below.​
​​​
  • VPC​
  • ​
    Region​
    VPC​
    VPC CIDR block​
    Subnet name​
    Subnet availability zone​
    Subnet​
    ECS private IP​
    China (Guangzhou)​
    vpc01​
    192.168.0.0/20​
    subnet01​
    Availability zone A​
    192.168.0.0/24​
    192.168.0.10​
    ​
    vpc03​
    192.168.32.0/20​
    subnet03​
    Availability zone A​
    192.168.32.0/24​
    192.168.32.10​
    China (Beijing)​
    vpc02​
    192.168.16.0/20​
    subnet02​
    Availability zone A​
    192.168.16.0/24​
    192.168.16.10​
    ​
    vpc04​
    192.168.48.0/20​
    subnet04​
    Availability zone A​
    192.168.48.0/24​
    192.168.48.10​
    ​
  • Transit Router​
Configuration procedures​
tip​
This example only covers required parameters. Leave other parameters at their default values.​
Step 1: Configure a TR instance in China (Guangzhou)​
  1. Create a TR instance.​
tip​
When you create a TR instance, the system automatically creates a system route table for it to forward traffic from the inter-region attachment. The following uses tr01's system route table (named tr01-rtb-sys) as an example.​
  1. Create a TR custom route table.​
  • Create two custom route tables for tr01 (tr01-rtb-set1 and tr01-rtb-set2) to forward traffic from respective attachments (attach-vpc01 and attach-vpc03). For procedure, see Creating a route table.​
  1. Create a VPC attachment.​
  • Basic configuration​
  • ​
    Parameter​
    Description​
    Example​
    (attach-vpc01)​
    Example​
    (attach-vpc03)​
    Name​
    Type the name for the attachment.​
    attach-vpc01​
    attach-vpc03​
    AZs and Subnets​
    Select the entry point where TR connects to the VPC. Select the availability zone and then the subnet, and set the selected availability zone as the default availability zone.​
    tip​
    This example uses a single availability zone, so only one subnet is selected. We recommend using multiple availability zones for greater reliability in actual scenarios.​
    Availability zone A A, subnet01​
    Availability zone A, subnet03​
    ​
  • Route configuration​
  • ​
    Parameter​
    Description​
    Example​
    (attach-vpc01)​
    Example​
    (attach-vpc03)​
    Association forwarding​
    Enable association forwarding for both attach-vpc01 and attach-vpc03, and specify the route table that the TR uses to forward traffic from attach-vpc01 and attach-vpc03.​
    Enabled, tr01-rtb-set1​
    Enabled, tr01-rtb-set2​
    Route learning​
    Enable route learning for both attach-vpc01 and attach-vpc03 to allow the specified TR route tables to automatically learn respective subnet routes of vpc01 and vpc03.​
    Enabled, tr01-rtb-sys​
    Enabled, tr01-rtb-sys​
    Auto Publish Route​
    Enable Auto Publish Route for both attach-vpc01 and attach-vpc03, automatically propagating routes in TR route tables (tr01-rtb-set1 and tr01-rtb-set2) associated with forwarding to respective VPCs (vpc01 and vpc03).​
    Check​
    Check​
    ​
  1. View TR and VPC routes​
  • The custom route tables (tr01-rtb-set1 and tr01-rtb-set2) contain no entries, while the routes in tr01-rtb-sys are listed below.​
  • ​
    Destination CIDR​
    Next Hop​
    Route status​
    Route type​
    Attachment type​
    Network Instances​
    192.168.32.0/24​
    attach-vpc03​
    Available​
    Route learning​
    VPC​
    vpc03​
    192.168.0.0/24​
    attach-vpc01​
    Available​
    Route learning​
    VPC​
    vpc01​
    ​
  • In this example, since the vpc01 route table learns routes from the tr01-rtb-set1, and the vpc03 route table learns from tr01-rtb-set2, routes in the vpc01 and vpc03 route tables are unchanged.​
Step 2: Configure a TR instance in China (Beijing)​
  1. Create a TR instance.​
tip​
After the TR instance is created, the system automatically creates a system route table (to forward traffic from attach-Inter-region). Record the name of this system route table (tr02-rtb-sys). The following uses tr02-rtb-sys as an example.​
  1. Create a TR custom route table.​
  • Create two custom route tables for tr02 (tr02-rtb-set1 and tr02-rtb-set2) to forward traffic from respective attachments (attach-vpc02 and attach-vpc04). For procedure, see Creating a route table.​
  1. Create a network instance attachment.​
  • Basic configuration​
  • ​
    Parameter​
    Description​
    Example​
    (attach-vpc02)​
    Example​
    (attach-vpc04)​
    Name​
    Type the name for the attachment.​
    attach-vpc02​
    attach-vpc04​
    AZs and Subnets​
    Select the entry point where TR connects to the VPC. Select the availability zone and then the subnet, and set the selected availability zone as the default availability zone.​
    tip​
    This example uses a single availability zone, so only one subnet is selected. We recommend using multiple availability zones for greater reliability in actual scenarios.​
    Availability zone A, subnet02​
    Availability zone A, subnet04​
    ​
  • Route configuration​
  • ​
    Parameter​
    Description​
    Example​
    (attach-vpc02)​
    Example​
    (attach-vpc04)​
    Association forwarding​
    Enable association forwarding for both attach-vpc02 and attach-vpc04, and specify the route table that tr02 uses to forward traffic from attach-vpc02 and attach-vpc04.​
    Enabled, tr02-rtb-set1​
    Enabled, tr02-rtb-set2​
    Route learning​
    Enable route learning for both attach-vpc02 and attach-vpc04 to allow the specified TR route tables to automatically learn respective subnet routes of vpc02 and vpc04.​
    Enabled, tr02-rtb-sys​
    Enabled, tr02-rtb-sys​
    Auto Publish Route​
    Enable Auto Publish Route for both attach-vpc02 and attach-vpc04, automatically propagating routes in TR route tables (tr02-rtb-set1 and tr02-rtb-set2) associated with forwarding to respective VPCs (vpc02 and vpc04).​
    Check​
    Check​
    ​
  1. View TR and VPC routes​
  • The custom route tables (tr02-rtb-set1 and tr02-rtb-set2) contain no entries, while the routes in tr02-rtb-sys are listed below.​
  • ​
    Destination CIDR​
    Next Hop​
    Route status​
    Route type​
    Attachment type​
    Network Instances​
    192.168.16.0/24​
    attach-vpc02​
    Available​
    Route learning​
    VPC​
    vpc02​
    192.168.48.0/24​
    attach-vpc04​
    Available​
    Route learning​
    VPC​
    vpc04​
    ​
  • In this example, since the vpc02 route table learns routes from the tr02-rtb-set1, and the vpc04 route table learns from tr02-rtb-set2, entries in the vpc02 and vpc04 route tables are unchanged.​
Step 3: Configure inter-region bandwidth​
  1. Create a bandwidth package.​
  • Create a bandwidth package (named trbp01) to provide bandwidth resources for the inter-region attachment. For procedure, see Creating a TR bandwidth package.​
  1. Create an inter-region attachment.​
  • Create an inter-region attachment to link the TR instance in China (Guangzhou) and the TR instance in China (Beijing). For procedure, see Creating an inter-region attachment.​
  • This example uses the TR instance in China (Guangzhou), tr01, as Local TR to create an inter-region attachment. Specific parameters are shown in the table below.​
  • ​
    Parameter​
    Description​
    Example​
    Name​
    Type the name for the inter-region attachment.​
    attach-Inter-region​
    Bandwidth package​
    Add to the created bandwidth package (trbp01) and allocate bandwidth.​
    Checked, trbp01, 2 Mbps​
    Local associated route table​
    Enable association forwarding, and specify that the local TR instance (tr01) uses tr01-rtb-sys to forward traffic from the inter-region attachment.​
    Enabled, tr01-rtb-sys​
    Remote TR association forwarding​
    Enable association forwarding, and specify the peer TR instance (tr02) uses tr02-rtb-sys to forward traffic from the inter-region attachment.​
    Enabled, tr02-rtb-sys​
    Local TR route learning​
    Enable route learning to allow the specified TR route table to automatically learn routes from the peer TR route table (tr02-rtb-sys) associated with forwarding.​
    tr01-rtb-set2​
    Remote TR route learning​
    Enable route learning to allow the specified TR route table to automatically learn routes from the local TR route table (tr01-rtb-sys) associated with forwarding.​
    tr02-rtb-set1​
    ​
  1. Configure a TR route pointing to the inter-region attachment.​
  • Add the static route pointing to the inter-region attachment to respective custom route tables (tr01-rtb-set1 and tr02-rtb-set2). Specific routes are listed in the table below. For procedure, see Create a static route.​
  • Route table (tr01-rtb-set1)​
  • ​
    Parameter​
    Route name​
    Destination CIDR​
    Black hole routing​
    Next Hop type​
    Next Hop​
    1​
    Routing traffic to vpc02​
    192.168.16.0/20​
    No​
    Inter-region attachment​
    attach-Inter-region​
    ​
  • Route table (tr02-rtb-set2)​
  • ​
    Parameter​
    Route name​
    Destination CIDR​
    Black hole routing​
    Next Hop type​
    Next Hop​
    1​
    Forwarding traffic to vpc03​
    192.168.32.0/20​
    No​
    Inter-region attachment​
    attach-Inter-region​
    ​
  1. View TR and VPC routes​
  • The routes in tr01-rtb-set1 and tr01-rtb-set2 are listed in the following table.​
  • ​
    Route table name​
    Destination CIDR​
    Next Hop​
    Route status​
    Route type​
    Attachment type​
    Network Instances​
    tr01-rtb-set1​
    192.168.16.0/20​
    attach-Inter-region​
    Available​
    Static​
    TR​
    tr02​
    tr01-rtb-set2​
    192.168.16.0/20​
    attach-Inter-region​
    Available​
    Route learning​
    TR​
    tr02​
    ​
    192.168.48.0/20​
    attach-Inter-region​
    Available​
    Route learning​
    TR​
    tr02​
    ​
  • The routes in tr02-rtb-set1 and tr02-rtb-set2 are listed in the following table.​
  • ​
    Route table name​
    Destination CIDR​
    Next Hop​
    Route status​
    Route type​
    Attachment type​
    Network Instances​
    tr02-rtb-set1​
    192.168.0.0/20​
    attach-Inter-region​
    Available​
    Route learning​
    TR​
    tr01​
    ​
    192.168.32.0/20​
    attach-Inter-region​
    Available​
    Route learning​
    TR​
    tr01​
    tr02-rtb-set2​
    192.168.32.0/20​
    attach-Inter-region​
    Available​
    Static​
    TR​
    tr01​
    ​
  • In this example, the VPC route tables learn routes from respective tr route tables: vpc01 from tr01-rtb-set1, vpc03 from tr01-rtb-set2, vpc02 from tr02-rtb-set1, and vpc04 from tr02-rtb-set2. The routes in each VPC route table are listed in the following table.​
  • ​
    VPC route table​
    Destination CIDR​
    Status​
    Next Hop type​
    Next Hop​
    vpc01​
    192.168.16.0/20​
    Available​
    TR​
    tr01​
    ​
    192.168.0.0/24​
    Available​
    InnerSubnet​
    System default​
    ​
    100.64.0.0/10​
    Available​
    System​
    System default​
    vpc03​
    192.168.48.0/20​
    Available​
    TR​
    tr01​
    ​
    192.168.16.0/20​
    Available​
    TR​
    tr01​
    ​
    192.168.32.0/24​
    Available​
    InnerSubnet​
    System default​
    ​
    100.64.0.0/10​
    Available​
    System​
    System default​
    vpc02​
    192.168.32.0/20​
    Available​
    TR​
    tr02​
    ​
    192.168.0.0/20​
    Available​
    TR​
    tr02​
    ​
    192.168.16.0/24​
    Available​
    InnerSubnet​
    System default​
    ​
    100.64.0.0/10​
    Available​
    System​
    System default​
    vpc04​
    192.168.32.0/20​
    Available​
    TR​
    tr02​
    ​
    192.168.48.0/24​
    Available​
    InnerSubnet​
    System default​
    ​
    100.64.0.0/10​
    Available​
    System​
    System default​
    ​
Step 4: Configure a VPC custom route (optional)​
warning​
  • In this example, this step is not required since Auto Publish Route is enabled when creating the attachment in Step 1 and Step 2.​
  • If you do not enable Auto Publish Route at creation, follow the steps below to configure a custom route for respective VPCs.​
  1. Click the instance name in the Name/ID column.​
  1. In the Associated resources section, click the digit to the right of VPC resource > Route Table.​
  1. Click the target route table name.​
  1. In the section below Basic information, select the Route Entry > Custom route tab.​
  1. Click Add route, and configure the route based on the table below.​
  • Route configuration for vpc01​
  • ​
    No.​
    Destination CIDR​
    Next Hop type​
    Next Hop​
    1​
    192.168.16.0/20​
    TR​
    tr01​
    ​
  • Route configuration for vpc02​
  • ​
    No.​
    Destination CIDR​
    Next Hop type​
    Next Hop​
    1​
    192.168.0.0/20​
    TR​
    tr02​
    2​
    192.168.32.0/20​
    TR​
    tr02​
    ​
  • Route configuration for vpc03​
  • ​
    No.​
    Destination CIDR​
    Next Hop type​
    Next Hop​
    1​
    192.168.16.0/20​
    TR​
    tr01​
    2​
    192.168.48.0/20​
    TR​
    tr01​
    ​
  • Route configuration for vpc04​
  • ​
    No.​
    Destination CIDR​
    Next Hop type​
    Next Hop​
    1​
    192.168.32.0/20​
    TR​
    tr02​
    ​
  1. Click Create to complete configuration.​
  1. Review the custom routes in each VPC route table as shown in the table below.​
  • ​
    VPC route table​
    Destination CIDR​
    Status​
    Next Hop type​
    Next Hop​
    vpc01​
    192.168.16.0/20​
    Available​
    TR​
    tr01​
    vpc02​
    192.168.32.0/20​
    Available​
    TR​
    tr02​
    ​
    192.168.0.0/20​
    Available​
    TR​
    tr02​
    vpc03​
    192.168.48.0/20​
    Available​
    TR​
    tr01​
    ​
    192.168.16.0/20​
    Available​
    TR​
    tr01​
    vpc04​
    192.168.32.0/20​
    Available​
    TR​
    tr02​
    ​
Result validation​
  1. Log in to the ECS instance in vpc01. For procedure, see Logging on to a Linux instance or Logging on to a Windows instance.​
  1. Execute the ping command to connect to respective servers in vpc02, vpc03 and vpc04, verifying that vpc01 communicates with vpc02, but not with vpc03 or vpc04.​
  1. Similarly, log in to respective ECS instances in vpc02, vpc03 and vpc04, and execute the ping command to connect other ECS instances, verifying interconnectivity and isolation between VPCs.​
  • vpc02 communicates with vpc01 and vpc03, but not with vpc04.​
  • vpc03 communicates with vpc02 and vpc04, but not with vpc01.​
  • vpc04 communicates with vpc03, but not with vpc01 or vpc02.​
Last updated: 2026.09.01 11:37:15