AWS Networking Fundamentals

Core Networking Services

Route Table Demo

In this guide, we walk through Amazon VPC route tables: inspecting the default table, creating custom tables, associating subnets, editing routes, and cleaning up resources.

1. Setting Up a Demo VPC and Subnets

First, create a new VPC using the AWS Console or CLI:

  • Name: vpcdemo
  • IPv4 CIDR block: 10.0.0.0/16
  • Enable IPv6: Yes

Next, add two subnets within vpcdemo:

Subnet NameIPv4 CIDRIPv6 CIDR
Subnet One10.0.1.0/24auto-assigned
Subnet Two10.0.2.0/24auto-assigned
  1. Subnet One

    • IPv4 CIDR: 10.0.1.0/24
    • IPv6 CIDR: auto-assigned
  2. Subnet Two

    • IPv4 CIDR: 10.0.2.0/24
    • IPv6 CIDR: auto-assigned

2. Viewing the Default Route Table

When you create a VPC, AWS automatically generates a main route table. Any subnet without an explicit association uses this default table.

Note

A subnet with no custom association inherits the VPC’s main route table.

Open the Route Tables page and select the default entry:

The image shows an AWS VPC (Virtual Private Cloud) management console, displaying details of a VPC named "vpcdemo" with its configuration and status information.

Here you’ll see two default routes:

  • 10.0.0.0/16 → local (IPv4 internal traffic)
  • ::/0 → local (IPv6 internal traffic)

The image shows an AWS VPC Management Console displaying route table details, including two active routes with their destinations and targets.

Under Subnet Associations, subnets without explicit associations are listed:

The image shows an AWS VPC Management Console screen displaying route tables, with a focus on subnet associations. It lists subnets without explicit associations and their corresponding details.

3. Creating and Associating a Custom Route Table

3.1 Create Route Table One

  1. Navigate to Route TablesCreate route table.
  2. Name: route-table-one
  3. VPC: vpcdemo

The image shows the AWS Management Console interface for creating a route table, with fields for naming the route table and selecting a VPC. There is also an option to add tags to the resource.

3.2 Associate Subnet One

  1. Select the route-table-one entry.
  2. Click Subnet AssociationsEdit subnet associations.
  3. Check Subnet OneSave.

Traffic originating in Subnet One now follows the rules in route-table-one.

4. Adding a Second Custom Route Table

Repeat the process to isolate Subnet Two:

  1. Create route tableName: route-table-twoVPC: vpcdemo
  2. Select route-table-twoSubnet AssociationsEdit → Check Subnet TwoSave

The image shows an AWS VPC Management Console screen displaying details of a route table, including route information and subnet associations.

This setup illustrates how:

  • Public subnets can route via an Internet Gateway
  • Private subnets remain isolated

5. Editing Routes in a Route Table

To add or update routes:

  1. Select a route table (e.g., route-table-one).
  2. Go to RoutesEdit routes.
  3. Click Add route:
    • Destination: 0.0.0.0/0 (all IPv4 traffic)
    • Target: select an Internet Gateway, NAT Gateway, etc.
  4. Click Save changes.

The image shows the AWS VPC Management Console with the "Edit routes" section open, displaying route entries and a dropdown menu for selecting destinations.

Warning

Ensure that your destination CIDR block and target are correctly configured to avoid unintended internet exposure.

Routes are evaluated by the most specific matching prefix to determine the next hop.

6. Cleaning Up Resources

To avoid unnecessary charges, delete the vpcdemo VPC. AWS will automatically remove associated subnets and custom route tables.

  1. Select vpcdemoActionsDelete VPC.
  2. Confirm by typing deleteDelete.

The image shows an AWS VPC Management Console where a user is in the process of deleting a VPC named "vpcdemo," along with associated resources. The user has typed "delete" to confirm the action and is about to click the "Delete" button.


In this tutorial, you learned how to inspect AWS VPC route tables, create custom tables, associate subnets, modify routes, and clean up.

References

Watch Video

Watch video content

Previous
Routing in VPC