Interview Prep/AWS/VPC and Networking

How do route tables work, including the local route and longest-prefix match?

IntermediateConceptVPC and Networking
Answer

Every subnet is associated with one route table (the main one if not explicit). Every table has an immutable local route for the VPC CIDR. When multiple routes match, the most specific prefix wins; for equal prefixes, static routes beat propagated ones and prefix-list/endpoint routes beat others.

aws ec2 create-route --route-table-id rtb-0abc \
  --destination-cidr-block 0.0.0.0/0 --nat-gateway-id nat-0def
aws All AWS questions Roadmap: AWS core services

More on VPC and Networking