Creating Custom Route Tables

Last updated: 2021-07-05 15:40:58

    A route table is used to control the outbound traffic of the subnet. It can contain multiple routing policies There are default route table and custom route tables. The default route table (local route) allows private network interconnection in the VPC, which cannot be deleted, but can be configured with routing policies the same way as you configure a custom route table. This document describes how to create and configure a custom route table.

    Directions

    1. Log in to the VPC console.

    2. Click Route Tables on the left sidebar to access the management page.

    3. Click + New.

    4. In the pop-up dialog, enter the route table name, select the VPC to which the route table belongs, and configure the routing policies.

      Note:

      You can configure routing policies when creating a route table. Alternatively, after a route table is created, you can click the route table ID to enter the Basic Information page and click + New routing policies to configure routing policies.

      Configuring a routing policy :

    ParameterDescription
    DestinationThe destination IP range to which the traffic is forwarded. The configuration should meet the following requirements:
    • Enter an IP range. If you want to enter a single IP, set the mask to 32 (for example, `172.16.1.1/32`).
    • The destination cannot be an IP range of the VPC where the route table resides, because the local route already allows private network interconnection in this VPC.

    Note: If you have deployed a TKE service in the VPC, the destination you configure in the route table policy of VPC subnet cannot fall within the VPC CIDR block or contain the TKE IP range. For example, if the VPC CIDR block is `172.168.0.0/16` and the TKE CIDR block is `192.168.0.0/16`, the destination IP range should not fall within `172.168.0.0/16`, or contain `192.168.0.0/16` when you configure routing policy for a VPC subnet.

    Next hop typeThe egress of the VPC data packets. The following types are supported:
    • NAT Gateway: the traffic directed to a destination IP range is forwarded to a NAT Gateway.
    • Peering Connections: the traffic directed to a destination IP range is forwarded to a VPC on the other side of a peering connection.
    • Direct Connect Gateway: the traffic directed to a destination IP range is forwarded to a direct connect gateway.
    • High Availability Virtual IP: the traffic directed to a destination IP range is forwarded to a HAVIP.
    • VPN Gateway: the traffic directed to a destination IP range is forwarded to a VPN gateway.
    • Public IP of CVM: the traffic directed to a destination IP range is forwarded to the public IP (including EIPs) of a CVM instance in a VPC.
    • CVM: the traffic directed to a destination IP range is forwarded to a CVM instance in a VPC.
    Next hopSpecifies the next hop instance to which the traffic is redirected, such as the gateway or CVM IP.
    NotesDescribes the purpose of the route for resource management. This parameter is optional.
    Add a line: configures multiple routing policies if needed. You can click the deletion icon in the **Operation** column to delete the unnecessary routing policies. A custom route table should contain at least one routing policy.
    1. After completing the configurations, click Create. Then the route table will be displayed in the list.

    Configuring HAVIP

    Currently, only the routing policies whose Next hop type is High Availability Virtual IP, VPN Gateway, or CVM in the default or custom route tables can be manually published to or withdrawn from CCN.

    1. Click the route table ID to enter the details page.
    2. You can perform the following operations as needed:
      • Click Publish to CCN to publish an enabled routing policy to CCN.
      • Click Withdraw from CCN to withdraw a custom routing policy that has been published to CCN.
      • Click Edit to modify the routing policy.
      • Click Delete to delete a disabled routing policy.