AWS VPC: How does route table redirect local traffic to the right subnet and instance?



Here is an AWS typical VPC, which is composed of the following components

  • two subnets
  • Internet Gateway
  • Route table
  • Instances

Imagine a scenario

step1, instance (private IP in subnet1 send a packet to IP (in subnet2).

step2, the packet reaches the route table, the route table redirect the packet to the target local.

step3, Some magic happens. 🤔

step4, instance( receives the packet.

The following questions are about the magic in step3.

  1. What does local mean in this place? the VPC network?
  2. what’s the topology of vpc and subnets?
  3. How does route table know which subnet should be the right subnet to receive this packet?
  4. How does route table know which instance should be the right instance to receive this packet?
  5. How does route table redirect the packet to the instance(
  6. If I would like to better understand it, which kind of background knowledge should I learn first?


It might become easier to understand if you replace “route table” with “router” in the steps. The Router in your diagram is the one actually routing the traffic. The route table is only part of the configuration of the Router. The Router also knows about all the subnet CIDR ranges. They are subsets of the VPC CIDR range.

In a route table, the local entry is usually configured with the CIDR range of the entire VPC. So in step 2, the Router looks up the route table, and sees that the destination is “local”, i.e. another host in the same VPC. In step 3, it would then look through the subnet CIDR ranges, sees that is in subnet2’s range, and so routes the packets there.

Leave a Reply