Route Tables

Configuring Route Tables in AWS

Creating Route Tables

  • Route tables are created from the VPC dashboard in the AWS Management Console.

  • Each subnet in the VPC requires its own route table for specific traffic rules.

  • Steps to create a route table:

    • Navigate to the Route Tables section in the VPC dashboard.

    • Select “Create route table” and provide a name (e.g., public-route-table-1).

    • Associate the route table with the appropriate subnet (e.g., public-subnet-1).

Associating Route Tables with Subnets

  • After creating a route table, it must be associated with a specific subnet.

  • Steps to associate a route table:

    • Select the created route table.

    • Choose “Edit subnet associations” and select the target subnet.

    • Save the associations to finalize the configuration.

Public Route Tables

  • Public route tables direct Internet-bound traffic to the Internet gateway.

  • Steps to configure public route tables:

    • Add a route with the destination 0.0.0.0/0 (CIDR notation for all IP addresses).

    • Set the target to the Internet gateway attached to the VPC.

Private Route Tables

  • Private route tables direct Internet-bound traffic to the NAT gateway in the public subnet.

  • Steps to configure private route tables:

    • Add a route with the destination 0.0.0.0/0 .

    • Set the target to the NAT gateway deployed in the public subnet.

Ensuring Proper Traffic Flow

Public Subnets and Internet Gateway

  • This configuration enables instances in public subnets to send and receive traffic from the Internet.

Private Subnets and NAT Gateway

  • Private subnets have routes directing Internet-bound traffic to the NAT gateway.

  • This setup allows instances in private subnets to make outbound Internet connections securely.

  • Inbound Internet traffic is blocked, ensuring isolation and security.

Internal Communication Within the VPC

  • The default route in every route table allows internal communication between resources in different subnets within the same VPC.

  • No additional configuration is required for internal traffic.

Summary

Key Takeaways

  • Route tables are essential for directing traffic within a VPC and to external networks.

  • Public subnets require routes to the Internet gateway, while private subnets require routes to the NAT gateway.

  • Proper configuration of route tables ensures secure and efficient traffic flow within the VPC.