All Products
Search
Document Center

Cloud Enterprise Network:Selective VPC-to-VPC communication

Last Updated:Jun 03, 2026

Use CEN routing policies to deny VPC-to-VPC communication by default, then selectively permit traffic between specific VPCs with high-priority allow policies.

Prerequisites

Note

This topic applies only to Basic Edition transit routers.

Background information

By default, all network instances attached to a CEN instance (VPCs, VBRs, etc.) can communicate with each other. For complex environments, a more secure approach is to deny all communication with a low-priority routing policy, then selectively permit traffic with high-priority policies.

Selective VPC communication

In this example, VPC1 and VPC2 are in China (Hong Kong), and VPC3 is in Germany (Frankfurt). All three are attached to the same CEN instance with full-mesh connectivity. You configure a low-priority policy to deny routes from the transit routers in both regions, then create a high-priority policy to permit communication only between VPC1 and VPC3.

Network plan

The following table outlines the network plan for VPC1, VPC2, and VPC3.

Network instance

CIDR block

ECS IP address

VPC1

VPC CIDR block: 10.0.0.0/8

vSwitch1 CIDR block: 10.0.1.0/24

vSwitch2 CIDR block: 10.0.2.0/24

ECS1: 10.0.1.95

ECS2: 10.0.2.120

VPC2

VPC CIDR block: 172.16.0.0/12

vSwitch CIDR block: 172.16.1.0/24

ECS: 172.16.1.80

VPC3

VPC CIDR block: 192.168.0.0/16

vSwitch CIDR block: 192.168.1.0/24

ECS: 192.168.1.151

Step 1: Create a deny-by-default policy

Create routing policies that deny all VPC routes from the transit routers in China (Hong Kong) and Germany (Frankfurt).

  1. Log on to the CEN console.

  2. On the CEN Instance page, find the target CEN instance and click its ID.

  3. On the details page of the CEN instance, click the ID of the transit router for the region where you want to configure a routing policy.

  4. On the details page of the transit router, click the Route Table tab, and then click Route Maps.

  5. On the Route Maps page, click Add Route Map. On the Add Routing Policy page, set the following parameters for the Germany (Frankfurt) transit router and click OK.

    • Policy Priority: Enter 100. Lower values indicate higher priority.

    • Description: (Optional) In this example, enterDeny routes advertised by the transit router to all VPCs in the Germany (Frankfurt) region.

    • Region: In this example, selectGermany (Frankfurt).

    • Policy Direction: In this example, selectOutbound Gateway.

    • Conditions: Set Destination Instance Type to VPC.

    • Strategic Behavior: Select Deny.

  6. On the Add Route Map page, set the following parameters for the China (Hong Kong) transit router and click OK.

    • Policy Priority: Enter 100. Lower values indicate higher priority.

    • Description: (Optional) In this example, enterDeny routes advertised by the transit router to all VPCs in the China (Hong Kong) region.

    • Region: In this example, selectChina (Hong Kong).

    • Policy Direction: In this example, selectOutbound Gateway.

    • Conditions: Set Destination Instance Type to VPC.

    • Strategic Behavior: Select Deny.

    After adding the policies, check the Network Instance Route Table tab to verify that all three VPCs reject routes from their respective transit routers. The following figure shows VPC1.View VPC1 routes

Step 2: Permit routes from VPC3 to VPC1

  1. In the left-side navigation pane, click CEN Instance.

  2. On the CEN Instance page, find the target CEN instance and click its ID.

  3. On the details page of the CEN instance, click the ID of the transit router in the China (Hong Kong) region.

  4. On the details page of the transit router, click the Route Table tab, and then click Route Maps.

  5. On the Route Maps page, click Add Route Map. Configure a routing policy with the following parameters and then click OK.

    • Policy Priority: Enter 50. Lower values indicate higher priority.

    • Description: (Optional) In this example, enterPermit VPC1 to receive routes from VPC3.

    • Region: In this example, selectChina (Hong Kong).

    • Policy Direction: In this example, selectOutbound Gateway.

    • Conditions: Configure the following parameters:

      • Source Region: Select Germany (Frankfurt).

      • Source Instance IDs: Select the instance ID of VPC3.

      • Destination Instance IDs: Select the instance ID of VPC1.

    • Strategic Behavior: Select Allow.

    Check the Network Instance Route Table tab to verify that VPC1 now accepts routes from VPC3.VPC1 accepts VPC3 routes

Step 3: Permit routes from VPC1 to VPC3

  1. In the left-side navigation pane, click CEN Instance.

  2. On the CEN Instance page, find the target CEN instance and click its ID.

  3. On the details page of the CEN instance, click the ID of the transit router in the Germany (Frankfurt) region.

  4. On the details page of the transit router, click the Route Table tab, and then click Route Maps.

  5. On the Route Maps page, click Add Route Map. Configure a routing policy with the following parameters and then click OK.

    • Policy Priority: Enter 50. Lower values indicate higher priority.

    • Description: (Optional) In this example, enterPermit VPC3 to receive routes from VPC1.

    • Region: In this example, selectGermany (Frankfurt).

    • Policy Direction: In this example, selectOutbound Gateway.

    • Conditions: Configure the following parameters:

      • Source Region: Select China (Hong Kong).

      • Source Instance IDs: Select the instance ID of VPC1.

      • Destination Instance IDs: Select the instance ID of VPC3.

    • Strategic Behavior: Select Allow.

    Check the Network Instance Route Table tab to verify that VPC3 now accepts routes from VPC1.VPC3 accepts VPC1 routes

Step 4: Verify connectivity

  1. Log on to the ECS1 instance in VPC1.

  2. Run the ping command to ping the IP address of the ECS instance in VPC3.

    A successful response confirms that VPC1 and VPC3 can communicate.pingVPC3

  3. Log on to the ECS instance in VPC2.

  4. Run the ping command to ping the IP address of the ECS1 instance in VPC1.

    The command fails, confirming that VPC2 and VPC1 cannot communicate.VPC2 to VPC1 blocked

  5. Log on to the ECS instance in VPC3.

  6. Run the ping command to ping the IP address of the ECS instance in VPC2.

    The command fails, confirming that VPC3 and VPC2 cannot communicate.pingVPC3-2