Route Tables and Routes
What Is a Route Table?
A route table contains a set of routes that are used to control the traffic in and out of your subnets in a VPC. Each subnet must be associated with a route table. A subnet can only be associated with one route table, but you can associate multiple subnets with the same route table.
Both IPv4 and IPv6 routes are supported.
![](https://support.huaweicloud.com/intl/en-us/usermanual-vpc/en-us_image_0000001650535960.png)
- Default route table: Each VPC comes with a default route table. If you create a subnet in the VPC, the subnet associates with the default route table. The default route table ensures that subnets in a VPC can communicate with each other.
- You can add routes to, delete routes from, and modify routes in the default route table, but cannot delete the table.
- When you create a VPN, Cloud Connect, or Direct Connect connection, the default route table automatically delivers a route that cannot be deleted or modified.
- Custom route table: If you do not want to use the default route table, you can create a custom route table and associate it with the subnet. Custom route tables can be deleted if they are no longer required.
The custom route table associated with a subnet affects only the outbound traffic. The default route table of a subnet controls the inbound traffic.
![](https://support.huaweicloud.com/intl/en-us/usermanual-vpc/public_sys-resources/note_3.0-en-us.png)
By default, the quota for custom route tables is 0. To create custom route tables, apply for a quota increase first.
Route
You can add routes to both default and custom route tables and configure the destination, next hop type, and next hop for the routes to determine where network traffic is directed. Routes are classified into system routes and custom routes.
- System routes are automatically added by the VPC service and cannot be modified or deleted. After a route table is created, the following system routes will be added to the route table:
- Routes whose destination is 100.64.0.0/10 (IP address range used to deploy public services, for example, the DNS server). The routes direct instances in a subnet to access these services.
- Routes whose destination is 198.19.128.0/20 (IP address range used by internal services, such as VPC Endpoint).
- Routes whose destination is 127.0.0.0/8 (local loopback addresses)
- Routes whose destination is a subnet CIDR block and that enable instances in a VPC to communicate with each other.
- Custom routes are routes that you can add, modify, and delete. The destination of a custom route cannot overlap with that of a system route.
You can add a custom route and configure information such as the destination and next hop in the route to determine where network traffic is directed. Table 1 lists the supported types of next hops.
You cannot add two routes with the same destination to a VPC route table even if their next hop types are different. The route priority depends on the destination. According to the longest match routing rule, the destination with a higher matching degree is preferentially selected for packet forwarding.
Table 1 Next hop type Next Hop Type
Description
Supported Route Table
Server
Traffic intended for the destination is forwarded to an ECS in the VPC.
- Default route table
- Custom route table
Extension NIC
Traffic intended for the destination is forwarded to the extension NIC of an ECS in the VPC.
- Default route table
- Custom route table
BMS user-defined network
Traffic intended for the destination is forwarded to a BMS user-defined network.
- Custom route table
VPN gateway
Traffic intended for the destination is forwarded to a VPN gateway.
Custom route table
Direct Connect gateway
Traffic intended for the destination is forwarded to a Direct Connect gateway.
Custom route table
Cloud connection
Traffic intended for the destination is forwarded to a cloud connection.
Custom route table
Supplementary network interface
Traffic intended for the destination is forwarded to the supplementary network interface of an ECS in the VPC.
- Default route table
- Custom route table
NAT gateway
Traffic intended for the destination is forwarded to a NAT gateway.
- Default route table
- Custom route table
VPC peering connection
Traffic intended for the destination is forwarded to a VPC peering connection.
- Default route table
- Custom route table
Virtual IP address
Traffic intended for the destination is forwarded to a virtual IP address and then sent to active and standby ECSs to which the virtual IP address is bound.
- Default route table
- Custom route table
VPC endpoint
Traffic intended for the destination is forwarded to a VPC endpoint.
- Default route table
- Custom route table
Cloud container
Traffic intended for the destination is forwarded to a cloud container.
- Default route table
- Custom route table
Enterprise router
Traffic intended for the destination is forwarded to an enterprise router.
- Default route table
- Custom route table
Cloud firewall
Traffic intended for the destination is forwarded to a cloud firewall.
- Default route table
- Custom route table
Internet gateway
Traffic intended for the destination is forwarded to an internet gateway.
- Default route table
- Custom route table
If you specify the destination when creating a resource, a system route is delivered. If you do not specify a destination when creating a resource, a custom route that can be modified or deleted is delivered.
For example, when you create a NAT gateway, the system automatically delivers a custom route without a specific destination (0.0.0.0/0 is used by default). In this case, you can change the destination. However, when you create a VPN gateway, you need to specify the remote subnet as the destination of a route. In this case, this route will be delivered as a system route. Do not modify the route destination on the Route Tables page. If you do, the destination will be inconsistent with the configured remote subnet. To modify the route destination, go to the specific resource page and modify the remote subnet, then the route destination will be changed accordingly.
Notes and Constraints
- A VPC can be associated with a maximum of five route tables, including the default route table and four custom route tables.
- All route tables in a VPC can have a maximum of 1,000 routes, excluding system routes.
- In a VPC route table, the route priority is as follows:
- Local route: A route that is added by the system within a VPC. It has a higher priority than a custom route.
- Custom route: A route added by a user or routes that are delivered during instance creation. It uses the longest prefix match rule to find a destination for packet forwarding.
Figure 2 Viewing VPC route tables
Custom Route Table Configuration Process
![](https://support.huaweicloud.com/intl/en-us/usermanual-vpc/en-us_image_0000001908228884.png)
No. |
Step |
Description |
Reference |
---|---|---|---|
1 |
Create a custom route table. |
If your default route table cannot meet your service requirements, you can create a custom route table. The custom route table associated with a subnet only controls the outbound traffic. The default route table of a subnet controls the inbound traffic. |
|
2 |
Add a route. |
You can add a custom route and configure information such as the destination and next hop in the route to determine where network traffic is directed. |
|
3 |
Associate the route table with a subnet. |
After a route table is associated with a subnet, the routes in the route table control the routing for the subnet and apply to all cloud resources in the subnet. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot