Managing Routing Policies

Last updated: 2021-04-30 15:51:18

    The routing policies in the route table can be real-time added, deleted, queried, exported, or manually published to CCN or withdrawn from CCN. This document describes the relevant operations of routing policy.

    Adding a Routing Policy

    1. Log in to the VPC console, and select Route Tables in the left sidebar to go to the Route Table page.

    2. In the list, click the route table ID to be modified to go to the details page.

    3. Click +New routing policies.

    4. In the pop-up window, configure the routing policy.

      Note:

      If you have deployed a TKE service in the VPC, when you configure the routing policy of the route table for the VPC subnet, the destination cannot be within the CIDR block range of the VPC, nor can it contain the container IP range. For example, if a VPC CIDR block is 172.168.0.0/16 and the container network CIDR block is 192.168.0.0/16, when you configure the routing policy for the VPC subnet, the destination IP range cannot be in the range of 172.168.0.0/16, and cannot contain 192.168.0.0/16.

      Configuration ItemDescription
      DestinationThe destination IP range to which you want to forward subnet outbound traffic. The requirements are as follows:
      • The destination IP range can only be in the format of the IP range. If you want the destination to be a single IP, set the mask to 32 (for example, 172.16.1.1/32).
      • The destination cannot be an IP range in the VPC where the routing table is located, because the local routing has indicated that the private network is connected in this VPC by default.
      Next hop typeThe egress of the VPC data packets. The following types are supported:
      • NAT Gateway: the traffic designated for a destination IP range is forwarded to a NAT gateway.
      • Peering Connections: the traffic designated for a destination IP range is forwarded to a VPC on the other end of a peering connection.
      • Direct Connect Gateway: the traffic designated for a destination IP range is forwarded to a direct connect gateway.
      • High Availability Virtual IP: the traffic designated for a destination IP range is forwarded to a high availability virtual IP.
      • VPN Gateway: the traffic designated for a destination IP range is forwarded to a VPN gateway.
      • Public IP of CVM: the traffic designated for a destination IP range is forwarded to the public IP of a CVM instance in a VPC (including public IPs and elastic IPs).
      • CVM: the traffic designated for a destination IP range is forwarded to a CVM instance in a VPC.
      Next hopSpecify the next hop instance to redirect to, such as the gateway or CVM IP.
      NotesYou can custom the description of the route for resource management.
      Add a lineYou can click +Add a line to configure multiple routing policies, or click the deletion icon in the Operation column to delete the unnecessary routing policies.
    5. Click Create to complete the creation.

    Publishing a Routing Policy to CCN/Withdrawing a Routing Policy from CCN

    For the VPC or VPN instances associated with CCN, the routes are published to CCN by default. For the new custom routing policies that are not published to CCN by default, you need to manually publish them. The routing policies that are manually published or published by default can be withdrawn from CCN.
    Currently, only the routing policies whose Next hop type is High Availability Virtual IP, VPN Gateway, or CVM in the route tables (including the default route tables and the custom route tables) can be manually published to CCN/withdrawn from CCN.

    Prerequisites

    The VPCs where the high available virtual IP, VPN gateway, and CVM are located have been associated with CCN.

    Directions

    1. Log in to the VPC console, and select Route Tables in the left sidebar to go to the Route Table page.

    2. In the list, click the route table ID to be modified to go to the details page.

    3. You can perform the following operations as needed:

      • For the custom routing policy, you can click Publish to CCN to manually publish this routing policy to CCN.
      • For the custom routing policy that have been published to CCN, you can click Withdrawn from CCN to reclaim the policy.
      • Click Edit to modify the routing policy.

        Note:

        • When a routing policy is disabled, it cannot be published to CCN.
        • A routing policy cannot be disabled once being published to CCN.

    Editing a Routing Policy

    1. Log in to the VPC console, and select Route Tables in the left sidebar to go to the Route Table page.

    2. In the list, click the route table ID to go to the details page.

    3. Click Edit on the right of the routing policy to modify it.

    4. Click OK to complete the modification, or click Cancel to cancel the modification.

    Querying and Exporting a Routing Policy

    1. Log in to the VPC console, and select Route Tables in the left sidebar to go to the Route Table page.

    2. In the list, click a route table ID to go to the details page. You can find the routing policies in this route table.

    3. In the search box on the top right, you can query the routing policy by destination address.

    4. Click Export to export the routing policies in the list, and save it .csv format.

    Deleting a Routing Policy

    You can delete the unnecessary routing policies. Only the custom routing policies can be deleted.

    1. Log in to the VPC console, and select Route Tables in the left sidebar to go to the Route Table page.

    2. In the list, click the route table ID to be modified to go to the details page.

    3. Click Delete on the right of the routing policy that you want to delete.

    4. Please confirm the possible impact of deleting the policy, and click OK.