← Back to Questions
AWS

Explain about Route Tables?

Learn Explain about Route Tables? with simple explanations, real-time examples, interview tips and practical use cases.

Route Tables are one of the core networking components in AWS VPC architecture.

They determine how network traffic travels inside and outside the VPC.

Simple Definition: A Route Table is a set of routing rules that controls where network traffic from a subnet or gateway is directed.

Why Route Tables are Important

In cloud networking, resources communicate using IP routing.

Route Tables decide:

  • Where traffic should go
  • Whether internet access is allowed
  • How subnets communicate
  • How external networks are connected

High-Level Architecture

EC2 Instance
      |
Subnet
      |
Route Table
      |
Destination
    

Real-World Analogy

A Route Table works like Google Maps for network traffic.

It decides:

If destination = Internet
    go to Internet Gateway

If destination = Internal Network
    stay inside VPC
    

Main Components of Route Table

Component Purpose
Destination Target IP range
Target Next hop for traffic
Association Subnet linked to route table

Basic Route Table Structure

Destination Target
10.0.0.0/16 Local
0.0.0.0/0 Internet Gateway

Understanding the Routes

1. Local Route

10.0.0.0/16 → Local
    

This route allows communication within the VPC.

Example

EC2 Instance A
      |
VPC Internal Network
      |
EC2 Instance B
    

2. Internet Route

0.0.0.0/0 → Internet Gateway
    

This route sends all internet traffic to the Internet Gateway.

Types of Route Tables

Route Table Type Purpose
Main Route Table Default route table in VPC
Custom Route Table User-defined routing rules

Main Route Table

Every VPC automatically gets a Main Route Table.

Characteristics

  • Default routing table
  • Automatically associated with subnets
  • Contains local route by default

Custom Route Table

Organizations create custom route tables for advanced routing control.

Use Cases

  • Public subnet routing
  • Private subnet routing
  • NAT Gateway routing
  • VPN connectivity

Public Route Table

Public Subnets use route tables connected to an Internet Gateway.

Architecture

Public EC2
     |
Public Route Table
     |
Internet Gateway
     |
Internet
    

Public Route Table Example

Destination Target
10.0.0.0/16 Local
0.0.0.0/0 Internet Gateway

Private Route Table

Private Subnets typically use NAT Gateway for outbound internet access.

Architecture

Private EC2
      |
Private Route Table
      |
NAT Gateway
      |
Internet Gateway
      |
Internet
    

Private Route Table Example

Destination Target
10.0.0.0/16 Local
0.0.0.0/0 NAT Gateway

Route Table Associations

Route Tables must be associated with subnets.

Architecture

Route Table
      |
Subnet Association
      |
Subnet
      |
EC2 Instances
    

How Routing Works Internally

Packet Generated
       |
Check Route Table
       |
Find Matching Destination
       |
Forward Traffic to Target
    

Longest Prefix Match Rule

AWS Route Tables use longest prefix matching.

Example

Destination Target
10.0.1.0/24 VPN
10.0.0.0/16 Local

AWS chooses the most specific route.

Advanced Routing Targets

Target Purpose
Internet Gateway Internet access
NAT Gateway Private subnet internet access
VPC Peering VPC communication
VPN Gateway On-premise connectivity
Transit Gateway Multi-network routing

VPC Peering Routing

VPC A
   |
Route Table
   |
Peering Connection
   |
VPC B
    

Hybrid Cloud Routing

On-Premise Data Center
        |
VPN Gateway
        |
AWS Route Table
        |
VPC
    

Production Architecture Example

Internet
    |
Internet Gateway
    |
Public Route Table
    |
Public Subnet
    |
Load Balancer
    |
Private Route Table
    |
Application Subnet
    |
Database Subnet
    

Common Route Table Mistakes

  • Missing internet route
  • Incorrect NAT Gateway route
  • Wrong subnet association
  • Overlapping CIDR blocks

Security Best Practices

  • Use separate route tables for public and private subnets
  • Restrict unnecessary internet access
  • Use private routing for databases
  • Implement least privilege networking

Route Table vs Security Group

Feature Route Table Security Group
Purpose Traffic routing Traffic filtering
Level Subnet Instance
Controls Path Access

Real-World Banking Architecture

Internet
   |
Load Balancer
   |
Public Route Table
   |
Web Servers
   |
Private Route Table
   |
Application Servers
   |
Database Cluster
    

Interview Answer

Route Tables in AWS are collections of routing rules that determine where network traffic is directed inside a VPC.

Each route contains:

  • Destination CIDR block
  • Target resource

Route Tables are associated with subnets and control traffic flow to:

  • Internet Gateway
  • NAT Gateway
  • VPN Gateway
  • VPC Peering Connections

Public subnets typically route traffic to an Internet Gateway, while private subnets use NAT Gateway for outbound internet access.

Quick Summary Table

Component Purpose
Route Table Controls traffic routing
Destination Target IP range
Target Next network hop
Internet Gateway Public internet access
NAT Gateway Private outbound internet access

Useful Internal Links

Final Conclusion

Route Tables are fundamental networking components in AWS VPC architecture.

They control how traffic flows between subnets, the internet, and external networks.

Understanding Route Tables is essential for designing secure, scalable, and production-ready AWS infrastructures.

Why this AWS question is important?

This interview question helps candidates understand real-time backend development concepts, practical problem solving, coding fundamentals, system design basics and production-ready application behavior.

Practice this question carefully for Java backend roles, Spring Boot developer interviews, microservices interviews, company interviews and full-stack developer preparation.

About the Author

Naresh Kumar is a Senior Java Backend Engineer with experience building enterprise applications using Java, Spring Boot, Microservices, Docker, Kubernetes and Cloud technologies.