

# Transit gateway route tables in Amazon Transit Gateway
<a name="tgw-route-tables"></a>

Use transit gateway route tables to configure routing for your transit gateway attachments. A route table is a table that contains rules that direct how your network traffic is routed between your VPCs and VPNs. Each route in the table contains the range of IP addresses for the destinations that you want to send traffic to.

Transit gateway route tables allows you to associate a table with a transit gateway attachment. VPC, VPN, VPN Concentrator, Direct Connect gateway, Peering, and Connect attachments are all supported. When associated, routes for these attachments are propagated from the attachment to the target transit gateway route table. An attachment can be propagated to multiple route tables. 

Additionally you can create and manage static routes with a route table. For example, you might have a static route that's used as a backup route in the event of a network disruption that affects any dynamic routes.

**Topics**
+ [Create a transit gateway route table](create-tgw-route-table.md)
+ [View transit gateway route tables](view-tgw-route-tables.md)
+ [Associate a transit gateway route table](associate-tgw-route-table.md)
+ [Disassociate a transit gateway route table](disassociate-tgw-route-table.md)
+ [Enable route propagation](enable-tgw-route-propagation.md)
+ [Disable route propagation](disable-tgw-route-propagation.md)
+ [Create a static route](tgw-create-static-route.md)
+ [Delete a static route](tgw-delete-static-route.md)
+ [Replace a static route](tgw-replace-static-route.md)
+ [Export route tables to Amazon S3](tgw-export-route-tables.md)
+ [Delete a transit gateway route table](delete-tgw-route-table.md)
+ [Create a prefix list reference](create-prefix-list-reference.md)
+ [Modify a prefix list reference](modify-prefix-list-reference.md)
+ [Delete a prefix list reference](delete-prefix-list-reference.md)

# Create a transit gateway route table in Amazon Transit Gateway
<a name="create-tgw-route-table"></a>

**To create a transit gateway route table using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Choose **Create transit gateway route table**.

1. (Optional) For **Name tag**, type a name for the transit gateway route table. This creates a tag with the tag key "Name", where the tag value is the name that you specify.

1. For **Transit gateway ID**, select the transit gateway for the route table.

1. Choose **Create transit gateway route table**.

**To create a transit gateway route table using the Amazon CLI**  
Use the [create-transit-gateway-route-table](https://docs.amazonaws.cn/cli/latest/reference/ec2/create-transit-gateway-route-table.html) command.

# View transit gateway route tables using Amazon Transit Gateway
<a name="view-tgw-route-tables"></a>

**To view your transit gateway route tables using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. (Optional) To find a specific route table or set of tables, enter all or part of the name, keyword, or attribute in the filter field.

1. Select the checkbox for a route table, or choose its ID, to display information about its associations, propagations, routes, and tags.

**To view your transit gateway route tables using the Amazon CLI**  
Use the [describe-transit-gateway-route-tables](https://docs.amazonaws.cn/cli/latest/reference/ec2/describe-transit-gateway-route-tables.html) command.

**To view the routes for a transit gateway route table using the Amazon CLI**  
Use the [search-transit-gateway-routes](https://docs.amazonaws.cn/cli/latest/reference/ec2/search-transit-gateway-routes.html) command.

**To view the route propagations for a transit gateway route table using the Amazon CLI**  
Use the [get-transit-gateway-route-table-propagations](https://docs.amazonaws.cn/cli/latest/reference/ec2/get-transit-gateway-route-table-propagations.html) command.

**To view the associations for a transit gateway route table using the Amazon CLI**  
Use the [get-transit-gateway-route-table-associations](https://docs.amazonaws.cn/cli/latest/reference/ec2/get-transit-gateway-route-table-associations.html) command.

# Associate a transit gateway route table in Amazon Transit Gateway
<a name="associate-tgw-route-table"></a>

You can associate a transit gateway route table with a transit gateway attachment.

**To associate a transit gateway route table using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the route table.

1. In the lower part of the page, choose the **Associations** tab.

1. Choose **Create association**.

1. Choose the attachment to associate and then choose **Create association**.

**To associate a transit gateway route table using the Amazon CLI**  
Use the [associate-transit-gateway-route-table](https://docs.amazonaws.cn/cli/latest/reference/ec2/associate-transit-gateway-route-table.html) command.

# Delete an association for a transit gateway route table in Amazon Transit Gateway
<a name="disassociate-tgw-route-table"></a>

You can disassociate a transit gateway route table from a transit gateway attachment.

**To disassociate a transit gateway route table using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the route table.

1. In the lower part of the page, choose the **Associations** tab.

1. Choose the attachment to disassociate and then choose **Delete association**.

1. When prompted for confirmation, choose **Delete association**.

**To disassociate a transit gateway route table using the Amazon CLI**  
Use the [disassociate-transit-gateway-route-table](https://docs.amazonaws.cn/cli/latest/reference/ec2/disassociate-transit-gateway-route-table.html) command.

# Enable route propagation to a transit gateway route table in Amazon Transit Gateway
<a name="enable-tgw-route-propagation"></a>

Use route propagation to add a route from an attachment to a route table.

**To propagate a route to a transit gateway attachment route table**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the route table for which to create a propagation.

1. Choose **Actions**, **Create propagation**.

1. On the **Create propagation** page, choose the attachment.

1. Choose **Create propagation**.

**To enable route propagation using the Amazon CLI**  
Use the [enable-transit-gateway-route-table-propagation](https://docs.amazonaws.cn/cli/latest/reference/ec2/enable-transit-gateway-route-table-propagation.html) command.

# Disable route propagation in Amazon Transit Gateway
<a name="disable-tgw-route-propagation"></a>

Remove a propagated route from a route table attachment.

**To disable route propagation using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the route table to delete the propagation from.

1. On the lower part of the page, choose the **Propagations** tab.

1. Select the attachment and then choose **Delete propagation**.

1. When prompted for confirmation, choose **Delete propagation**.

**To disable route propagation using the Amazon CLI**  
Use the [disable-transit-gateway-route-table-propagation](https://docs.amazonaws.cn/cli/latest/reference/ec2/disable-transit-gateway-route-table-propagation.html) command.

# Create a static route in Amazon Transit Gateway
<a name="tgw-create-static-route"></a>

Create a static route for a VPC, VPN, or transit gateway peering attachment, or you can create a blackhole route that drops traffic that matches the route.

Static routes in a transit gateway route table that target a VPN attachment are not filtered by the Site-to-Site VPN. This might allow unintended outbound traffic flow when using a BGP-based VPN.

**To create a static route using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the route table for which to create a route.

1. Choose **Actions**, **Create static route**.

1. On the **Create static route** page, enter the CIDR block for which to create the route, and then choose **Active**.

1. Choose the attachment for the route.

1. Choose **Create static route**.

**To create a blackhole route using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the route table for which to create a route.

1. Choose **Actions**, **Create static route**.

1. On the **Create static route** page, enter the CIDR block for which to create the route, and then choose **Blackhole**.

1. Choose **Create static route**.

**To create a static route or blackhole route using the Amazon CLI**  
Use the [create-transit-gateway-route](https://docs.amazonaws.cn/cli/latest/reference/ec2/create-transit-gateway-route.html) command.

# Delete a static route in Amazon Transit Gateway
<a name="tgw-delete-static-route"></a>

Delete static routes from a transit gateway route table.

**To delete a static route using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the route table for which to delete the route, and choose **Routes**.

1. Choose the route to delete.

1. Choose **Delete static route**.

1. In the confirmation box, choose **Delete static route**.

**To delete a static route using the Amazon CLI**  
Use the [delete-transit-gateway-route](https://docs.amazonaws.cn/cli/latest/reference/ec2/delete-transit-gateway-route.html) command.

# Replace a static route in Amazon Transit Gateway
<a name="tgw-replace-static-route"></a>

Replace a static route in a transit gateway route table with a different static route.

**To replace a static route using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Choose the route that you want to replace in the route table. 

1. In the details section, choose the **Routes** tab.

1. Choose **Actions**, **Replace static route**.

1. For the **Type**, choose either **Active** or **Blackhole**.

1. From the **Choose attachment** drop-down, choose the transit gateway that will replace the current one in the route table.

1. Choose **Replace static route**.

**To replace a static route using the Amazon CLI**  
Use the [replace-transit-gateway-route](https://docs.amazonaws.cn/cli/latest/reference/ec2/replace-transit-gateway-route.html) command.

# Export route tables to Amazon S3 in Amazon Transit Gateway
<a name="tgw-export-route-tables"></a>

You can export the routes in your transit gateway route tables to an Amazon S3 bucket. The routes are saved to the specified Amazon S3 bucket in a JSON file.

**To export transit gateway route tables using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Choose the route table that includes the routes to export.

1. Choose **Actions**, **Export routes**.

1. On the **Export routes** page, for **S3 bucket name**, type the name of the S3 bucket.

1. To filter the routes exported, specify filter parameters in the **Filters** section of the page.

1. Choose **Export routes**.

To access the exported routes, open the Amazon S3 console at [https://console.amazonaws.cn/s3/](https://console.amazonaws.cn/s3/), and navigate to the bucket that you specified. The file name includes the Amazon Web Services account ID, Amazon Region, route table ID, and a timestamp. Select the file and choose **Download**. The following is an example of a JSON file that contains information about two propagated routes for VPC attachments.

```
{
  "filter": [
    {
      "name": "route-search.subnet-of-match",
      "values": [
        "0.0.0.0/0",
        "::/0"
      ]
    }
  ],
  "routes": [
    {
      "destinationCidrBlock": "10.0.0.0/16",
      "transitGatewayAttachments": [
        {
          "resourceId": "vpc-0123456abcd123456",
          "transitGatewayAttachmentId": "tgw-attach-1122334455aabbcc1",
          "resourceType": "vpc"
        }
      ],
      "type": "propagated",
      "state": "active"
    },
    {
      "destinationCidrBlock": "10.2.0.0/16",
      "transitGatewayAttachments": [
        {
          "resourceId": "vpc-abcabc123123abca",
          "transitGatewayAttachmentId": "tgw-attach-6677889900aabbcc7",
          "resourceType": "vpc"
        }
      ],
      "type": "propagated",
      "state": "active"
    }
  ]
}
```

# Delete a transit gateway route table in Amazon Transit Gateway
<a name="delete-tgw-route-table"></a>

**To delete a transit gateway route table using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. On the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the route table to delete.

1. Choose **Actions**, **Delete transit gateway route table**.

1. Enter **delete** and choose **Delete** to confirm the deletion.

**To delete a transit gateway route table using the Amazon CLI**  
Use the [delete-transit-gateway-route-table](https://docs.amazonaws.cn/cli/latest/reference/ec2/delete-transit-gateway-route-table.html) command.

# Create a route table prefix list reference in Amazon Transit Gateway
<a name="create-prefix-list-reference"></a>

You can reference a prefix list in your transit gateway route table. A prefix list is a set of one or more CIDR block entries that you define and manage. You can use a prefix list to simplify the management of the IP addresses that you reference in your resources to route network traffic. For example, if you frequently specify the same destination CIDRs across multiple transit gateway route tables, you can manage those CIDRs in a single prefix list, instead of repeatedly referencing the same CIDRs in each route table. If you need to remove a destination CIDR block, you can remove its entry from the prefix list instead of removing the route from every affected route table.

When you create a prefix list reference in your transit gateway route table, each entry in the prefix list is represented as a route in your transit gateway route table.

For more information about prefix lists, see [Prefix lists](https://docs.amazonaws.cn/vpc/latest/userguide/managed-prefix-lists.html) in the *Amazon VPC User Guide*.

**To create a prefix list reference using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. In the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the transit gateway route table.

1. Choose **Actions**, **Create prefix list reference**.

1. For **Prefix list ID**, choose the ID of the prefix list.

1.  For **Type**, choose if traffic to this prefix list should be allowed (**Active**) or dropped (**Blackhole**). 

1. For **Transit gateway attachment ID**, choose the ID of the attachment to which to route traffic.

1. Choose **Create prefix list reference**.

**To create a prefix list reference using the Amazon CLI**  
Use the [create-transit-gateway-prefix-list-reference](https://docs.amazonaws.cn/cli/latest/reference/ec2/create-transit-gateway-prefix-list-reference.html) command.

# Modify a prefix list reference in Amazon Transit Gateway
<a name="modify-prefix-list-reference"></a>

You can modify a prefix list reference by changing the attachment that the traffic is routed to, or indicating whether to drop traffic that matches the route.

You cannot modify the individual routes for a prefix list in the **Routes** tab. To modify the entries in the prefix list, use the **Managed Prefix Lists** screen. For more information, see [Modifying a prefix list](https://docs.amazonaws.cn/vpc/latest/userguide/managed-prefix-lists.html#modify-managed-prefix-list) in the *Amazon VPC User Guide*.

**To modify a prefix list reference using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. In the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the transit gateway route table.

1. In the lower pane, choose **Prefix list references**.

1. Choose the prefix list reference, and choose **Modify references**. 

1.  For **Type**, choose if traffic to this prefix list should be allowed (**Active**) or dropped (**Blackhole**). 

1. For **Transit gateway attachment ID**, choose the ID of the attachment to which to route traffic.

1. Choose **Modify prefix list reference**.

**To modify a prefix list reference using the Amazon CLI**  
Use the [modify-transit-gateway-prefix-list-reference](https://docs.amazonaws.cn/cli/latest/reference/ec2/modify-transit-gateway-prefix-list-reference.html) command.

# Delete a prefix list reference in Amazon Transit Gateway
<a name="delete-prefix-list-reference"></a>

If you no longer need a prefix list reference, you can delete it from your transit gateway route table. Deleting the reference does not delete the prefix list.

**To delete a prefix list reference using the console**

1. Open the Amazon VPC console at [https://console.amazonaws.cn/vpc/](https://console.amazonaws.cn/vpc/).

1. In the navigation pane, choose **Transit Gateway Route Tables**.

1. Select the transit gateway route table.

1. Choose the prefix list reference, and choose **Delete references**. 

1. Choose **Delete references**.

**To modify a prefix list reference using the Amazon CLI**  
Use the [delete-transit-gateway-prefix-list-reference](https://docs.amazonaws.cn/cli/latest/reference/ec2/delete-transit-gateway-prefix-list-reference.html) command.