This topic describes how to use routing policies to configure primary and secondary static routes for virtual border routers (VBRs) in the same region.
Prerequisites
This feature is supported only by Basic Edition transit routers.
The data center is connected to Alibaba Cloud by using Express Connect circuits. For more information, see Create and manage a dedicated connection over an Express Connect circuit.
A Cloud Enterprise Network (CEN) instance is created. The network instances that you want to connect to each other are attached to the CEN instance. For more information, see CEN instance and Manage network instance connections.
Background information
Routing policies accept or deny routes based on match conditions. You can configure match conditions to modify the attributes of routes that you want to accept.
As shown in the preceding figure, an enterprise has a data center located in the China (Hangzhou) region. The enterprise connects the data center to Alibaba Cloud by using two Express Connect circuits from two Internet service providers (ISPs). The port of Express Connect Circuit 1 is 10 Gbit/s, whereas the port of Express Connect Circuit 2 is 1 Gbit/s. VBR 1, VBR 2, and the virtual private cloud (VPC) are attached to the CEN instance. The enterprise uses the Express Connect circuits to connect the data center to Alibaba Cloud through load balancing. However, the enterprise needs to use Express Connect Circuit 2 as a secondary connection because the port of Express Connect Circuit 2 is slower than that of Express Connect Circuit 1. If Express Connect Circuit 1 is down, network traffic is automatically switched to Express Connect Circuit 2.
You can add a routing policy with a higher priority for VBR 1 that is connected to Express Connect Circuit 1, and then add a routing policy with a lower priority for VBR 2 that is connected to Express Connect Circuit 2. This way, Express Connect Circuit 1 functions as the primary connection and Express Connect Circuit 2 functions as the secondary connection.
Step 1: Set Express Connect Circuit 1 that is connected to VBR 1 as the primary connection
Perform the following steps to set Express Connect Circuit 1 as the primary connection:
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you want to manage.
On the instance details page, find the region where you want to add a routing policy and click the ID of the transit router deployed in the region.
On the details page of the transit router, click the Route Table tab and click Routing Policies.
On the Routing Policies page, click Add Routing Policy. Set the following parameters and click OK:
Routing Policy Priority: Enter a priority value for the routing policy. A smaller value indicates a higher priority. In this example, 20 is entered.
Region: Select the region to which you want to apply the routing policy. In this example, China (Hangzhou) is entered.
Policy Direction: Select the direction in which you want to apply the routing policy. In this example, Egress Regional Gateway is selected.
Match Conditions: Configure match conditions for the routing policy. In this example, Source Instance ID List is set to the ID of VBR 1.
Action Policy: Select the action that you want to perform on routes that meet the match conditions. In this example, Allow is selected.
Add Action Object: Specify a priority value for the routes that are accepted. In this example, the priority value is set to 10.
NoteBy default, the priority values of the accepted routes are 50. You can set a value from 1 to 100. A lower value indicates a higher priority.
Step 2: Set Express Connect Circuit 2 that is connected to VBR 2 as the secondary connection
Perform the following steps to set Express Connect circuit 2 as the secondary connection:
In the left-side navigation pane, click Instances.
On the Instances page, click the ID of the CEN instance that you want to manage.
On the instance details page, find the region where you want to add a routing policy and click the ID of the transit router deployed in the region.
On the details page of the transit router, click the Route Table tab and click Routing Policies.
On the Routing Policies tab, click Add Routing Policy. Set the following parameters and click OK:
Routing Policy Priority: Enter a priority value for the routing policy. A smaller value indicates a higher priority. In this example, 30 is entered.
Region: Select the region to which you want to apply the routing policy. In this example, China (Hangzhou) is entered.
Policy Direction: Select the direction in which you want to apply the routing policy. In this example, Egress Regional Gateway is selected.
Match Conditions: Configure match conditions for the routing policy. In this example, Source Instance ID List is set to the ID of VBR 2.
Action Policy: Select the action that you want to perform on routes that meet the match conditions. In this example, Allow is selected.
Add Action Object: Specify a priority value for the routes that are accepted. In this example, the priority value is set to 20.
NoteBy default, the priority values of the accepted routes are 50. You can set a value from 1 to 100. A lower value indicates a higher priority.