The route learning feature lets transit routers automatically learn routes from network instances. This feature reduces the errors of manual configuration and improves efficiency.
Limit
Only Enterprise Edition transit routers support route learning. View the edition of a transit router to see whether the feature is available for your transit router.
Scenario
Assume you have created two virtual private clouds (VPCs) in the China (Hangzhou) region and connected them to a transit router.
With the route learning feature, the transit router learns the system routes of the two VPCs and adds them to its default route table.
If the two VPC connections are associated with the default route table of the transit router, traffic from the VPCs to the transit router is forwarded to the next hop based on the routes that are automatically learned by the transit router.
Route advertisement
Route learning can be established between:
The route table of an Enterprise Edition transit router and multiple network instances.
A network instance and route tables of multiple Enterprise Edition transit routers.
After route learning is enabled, the instance automatically advertises routes to the Enterprise Edition transit router.
Connection type | Instance type | Automatically advertised routes |
VPC connection | VPC | System routes of VPCs.
|
VBR connection | Virtual border router (VBR) |
For more information about how to find these routes, see Add and manage routes. |
ECR connection | Express Connect Router (ECR) | Routes whose next hop is VBR. |
VPN connection | IPsec-VPN connection | The routes in the destination route tables of IPsec-VPN connections and BGP route tables. |
Inter-region connection | Transit router |
|
Create a route learning policy
Method 1: Create a policy along with a connection
When you create a network instance connection, select Propagate System Routes to Default Route Table of Transit Router in the Advanced Settings section as shown in the figure below. This creates a route learning policy, which lets the transit router automatically learn routes from the network instance.
To connect other types of instances, see Create a VPC connection, Create an ECR connection, Create a VBR connection, Create a VPN connection, and Create an inter-region connection.
Method 2: Create only a route learning policy
You can create only a route learning policy in the following scenarios:
Propagate System Routes to Default Route Table of Transit Router is not selected when creating a network instance connection.
A custom route table has been created for the transit router to learn routes from the network instance.
To create a route learning policy, perform the following steps:
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you want to manage.
Go to the tab and click the ID of the transit router that you want to manage.
On the details page of the transit router, click the Route Table tab.
In the left-side section, click the ID of the route table that you want to manage. On the details page of the route table, click the Route Propagation tab.
On the Route Propagation tab, click Enable Route Propagation. In the Enable Route Propagation dialog box, configure the following parameters and click OK:
Parameter
Description
Route Table
The current route table is selected by default.
Transit Router
The current transit router is selected by default.
Associated Connection
Select the network instance connection for which you want to enable route learning.
Once enabled, the network instance automatically advertises routes to the route table. Find the routes on the Route Entry tab.
Delete a route learning policy
After route learning is disabled between a network instance and a transit router, the routes advertised from the instance to the transit router are automatically withdrawn.
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you want to manage.
Go to the tab and click the ID of the transit router that you want to manage.
On the details page of the transit router, click the Route Table tab.
In the left-side section, click the ID of the route table that you want to manage. On the details page of the route table, click the Route Propagation tab.
On the Route Propagation tab, find the target network instance connection and click Delete in the Actions column.
In the Disable Route Propagation dialog box, check the details and click OK.
References
EnableTransitRouterRouteTablePropagation: Creates a route learning policy.
ListTransitRouterRouteTablePropagations: Queries route learning policies of a route table in an Enterprise Edition transit router.
DisableTransitRouterRouteTablePropagation: Disables route learning.