Change a subnet route table - Amazon Virtual Private Cloud

Change a subnet route table

This section explains how to work with route tables. Note that this section is a grouping of procedures all related to making changes in subnet route table.

Determine the route table for a subnet

You can determine which route table a subnet is associated with by looking at the subnet details in the Amazon VPC console.

To determine the route table for a subnet
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Subnets.

  3. Select the subnet.

  4. Choose the Route table tab to view information about the route table and its routes. To determine whether the association is to the main route table, and if that association is explicit, see Determine which subnets and or gateways are explicitly associated.

Determine which subnets and or gateways are explicitly associated

You can determine how many and which subnets or gateways are explicitly associated with a route table.

The main route table can have explicit and implicit subnet associations. Custom route tables have only explicit associations.

Subnets that aren't explicitly associated with any route table have an implicit association with the main route table. You can explicitly associate a subnet with the main route table. For an example of why you might do that, see Replace the main route table.

To determine which subnets are explicitly associated using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Route tables.

  3. Check the Explicit subnet association column to determine the explicitly associated subnets and the Main column to determine whether this is the main route table.

  4. Select the route table and choose the Subnet associations tab.

  5. The subnets under Explicit subnet associations are explicitly associated with the route table. The subnets under Subnets without explicit associations belong to the same VPC as the route table, but are not associated with any route table, so they are implicitly associated with the main route table for the VPC.

To determine which gateways are explicitly associated using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Route tables.

  3. Select the route table and choose the Edge associations tab.

To describe one or more route tables and view its associations using the command line

Create a custom route table

You can create a custom route table for your VPC using the Amazon VPC console.

Note

There is a quota on the number of route tables that you can create per VPC. There is also a quota on the number of routes that you can add per route table. For more information, see Amazon VPC quotas.

To create a custom route table using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Route tables.

  3. Choose Create route table.

  4. (Optional) For Name, enter a name for your route table.

  5. For VPC, choose your VPC.

  6. (Optional) To add a tag, choose Add new tag and enter the tag key and tag value.

  7. Choose Create route table.

To create a custom route table using the command line

Add and remove routes from a route table

You can add, delete, and modify routes in your route tables. You can only modify routes that you've added.

For more information about working with static routes for a Site-to-Site VPN connection, see Editing Static Routes for a Site-to-Site VPN Connection in the AWS Site-to-Site VPN User Guide.

Note

There is a quota on the number of route tables that you can create per VPC. There is also a quota on the number of routes that you can add per route table. For more information, see Amazon VPC quotas.

To update the routes for a route table using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Route tables, and select the route table.

  3. Choose Actions, Edit routes.

  4. To add a route, choose Add route. For Destination enter the destination CIDR block, a single IP address, or the ID of a prefix list.

  5. To modify a route, for Destination, replace the destination CIDR block or single IP address. For Target, choose a target.

  6. To delete a route, choose Remove.

  7. Choose Save changes.

To update the routes for a route table using the command line
Note

If you add a route using a command line tool or the API, the destination CIDR block is automatically modified to its canonical form. For example, if you specify 100.68.0.18/18 for the CIDR block, we create a route with a destination CIDR block of 100.68.0.0/18.

Enable or disable route propagation

Route propagation allows a virtual private gateway to automatically propagate routes to your route tables. This means that you don't need to manually add or remove VPN routes.

To complete this process, you must have a virtual private gateway.

For more information, see Site-to-Site VPN routing options in the Site-to-Site VPN User Guide.

To enable route propagation using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Route tables, and then select the route table.

  3. Choose Actions, Edit route propagation.

  4. Select the Enable check box next to the virtual private gateway, and then choose Save.

To enable route propagation using the command line
To disable route propagation using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Route tables, and then select the route table.

  3. Choose Actions, Edit route propagation.

  4. Clear the Enable check box next to the virtual private gateway, and then choose Save.

To disable route propagation using the command line

Change the route table for a subnet

You can change the route table association for a subnet.

When you change the route table, your existing connections in the subnet are dropped unless the new route table contains a route for the same traffic to the same target.

To change a subnet route table association using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Subnets, and then select the subnet.

  3. From the Route table tab, choose Edit route table association.

  4. For Route table ID, select the new route table.

  5. Choose Save.

To change the route table associated with a subnet using the command line

Associate or disassociate a subnet with a route table

To apply route table routes to a particular subnet, you must associate the route table with the subnet. A route table can be associated with multiple subnets. However, a subnet can only be associated with one route table at a time. Any subnet not explicitly associated with a table is implicitly associated with the main route table by default.

You can disassociate a subnet from a route table. Until you associate the subnet with another route table, it's implicitly associated with the main route table.

To associate or disassociate a route table with a subnet using the console
  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Route tables, and then select the route table.

  3. On the Subnet associations tab, choose Edit subnet associations.

  4. Select or deselect the check box for the subnet to associate with the route table.

  5. Choose Save associations.

To associate a subnet with a route table using the command line
To disassociate a subnet from a route table using the command line