Routing Tables

Last updated: 2019-09-24 17:01:29

PDF

Introduction

A routing table consists of a series of routing policies that are used to control the traffic direction of subnets within the VPC. As shown below, Tencent Cloud provides two types of routing tables: default routing table and custom routing table. Each subnet must be associated with a routing table, and each routing table can be associated with multiple subnets.

The routing table consists of a series of routing policies. The routing policy includes the routing destination, the next hop type, and the next hop. The next hop type can be any component in the following figure.

Default Routing Table

When a user creates a VPC, the system automatically generates a default routing table. When a subnet is created afterwards, the subnet will automatically associate the default routing table if the user does not select a custom routing table. You can add, delete, and modify routing policies in the default routing table, but you cannot delete the default routing table.

Custom Routing Table

In addition to the default routing table, you can also create custom routing table in a VPC. The custom routing tables can be deleted. The user can setup a custom routing table for subnets with the same routing policies and associate it with all subnets that need to follow its routing policy. To do this, please refer to Bind Subnet and Routing Table.

Associating Routing Table

Each routing table can be associated with multiple subnets in the same VPC, but each subnet can only be associated with one routing table.

Routing Policy

Routing policies are used to control the routing path of packets. There are default and custom routing policies, and each routing policy contains three parameters:

  • Destination: Description of the destination network segment (only network segment is supported. If you wish the destination to be an IP, you can set the mask as 32, for example: 172.16.1.1/32). The destination cannot be a IP segment of the VPC where the routing table locates.
  • Next hop type: packet exit of the VPC. Supported next hop types for VPC include "public network gateway", "VPN gateway", and "direct connect gateway" etc.
  • Next hop: Specify the next hop instance to which you redirect (using the next hop ID).

Note:
All routing tables contain a default local routing policy, which means interconnection within VPC. The routing policy is [Local, Local, Local], which can not be deleted or modified.

Routing Policy Priority

When there are multiple routing policies in a routing table, the following routing priority applies:

  • Traffic within VPC: Match the traffic within VPC first
  • Exact match routing: Traffic in non-VPC is matched based on the exact match routing rule
  • Public IP: If match fails for all the routing rules, the Internet can be accessed through the public IP

For example, if a CVM in a VPC is bound to a elastic IP and it is in a subnet that is associated with a NAT gateway (In its routing table, the next hop of traffic from this subnet to Internet is set to "NAT gateway"), traffic generated by the CVM's access to Internet will be all redirected through the NAT gateway, because exact match routing has higher priority than public IP.

Usage Constraints

  • Each subnet must be associated with a routing table, and each routing table can be associated with multiple subnets
  • The default routing table and the custom routing table that has been associated with subnets cannot be deleted
  • The default local routing policy cannot be deleted
  • Dynamic routing protocols such as BGP and OSPF are not supported
  • As shown in the following table, there are number limit on the routing tables created and the routing policies added in each routing table:
Resource Limit
Number of routing tables per VPC 10
Number of routing tables associated with a subnet 1
Number of routing policies per routing table 50

Billing Method

The routing table is created and used completely free of charge. For other price information on VPC, refer to Overview of VPC Price.

Operating Instructions

Modifying Default Routing Table

When a VPC is created, the system will automatically create a default routing table, with which newly created subnets will be associated by default.

1) Log in to Tencent Cloud Console, click "Virtual Private Cloud" in the navigation bar, and enter the VPC Console.
2) Click "Routing Table" in the left navigation bar, and click the routing table ID in the routing table list to enter the routing table details page.
3) Click "Edit" button of the routing policy to start modifying the routing policy.
4) (Optional) Click "New Line" to add a routing policy. Enter the destination network segment, select the next hop type (public network gateway, VPN gateway, direct connect gateway, etc.), and then select the next hop ID.
5) (Optional) Click the button to the right of the routing policy to delete the routing policy.
6) Click "OK" button, and the edit will take effect immediately.

Creating Custom Routing Table

In addition to the default routing table automatically generated by the system, users can also customize a new routing table.

1) Log in to Tencent Cloud Console. Click "Virtual Private Cloud" in the navigation bar to enter the VPC Console.
2) Click "Routing Table" in the left navigation bar, click "New" button above the list and enter the routing table name, the VPC to which it belongs and the new routing policy in the pop-up box.
3) Click "Create" button to see your new routing table in the routing table list.

Deleting Custom Routing Table

The default routing table automatically generated by the system cannot be deleted, but the custom routing table can be created, modified and deleted at will.

1) Log in to Tencent Cloud Console. Click "Virtual Private Cloud" in the navigation bar to enter the VPC Console.
2) Click "Routing Table" in the left navigation bar and click "Delete" button next to the routing table to be deleted.
3) Click "Delete" button in the pop-up window to delete the selected custom routing table.

Modifying Routing Table Associated with a Subnet

1) Log in to Tencent Cloud Console. Click "Virtual Private Cloud" in the navigation bar to enter the VPC Console.
2) Click the "Subnet" tab in the left navigation bar, move the cursor to the subnet routing table that need to be modified and the "Edit" button will appear in the "Associated Routing Table" column.
3) Click "Edit" button, and select the associated routing table in the drop-down box.
4) Click "Save" to complete the association of the subnet with the routing table.

API Overview

You can use API to setup and manage your routing tables. Click to view Overview of All VPC APIs.