[AWS] VPC – Subnets and Routing Tables


  • A subnet is an isolated local network confined in a single AZ.
  • Different application tiers are in different subnets.
  • 5 IPs are reserved for a subnet (ex. /24 network  251 IPs available)
    • 0 (first) – Network, 1 – Router, 2 – DNS, 3 – Future, X (last) – Broadcast
  • Subnets must be associated with a route table.
  • Subnets are by default private unless created in a default VPC.
  • The CIDR block of a subnet cannot overlap the CIDR blocks of other subnets in the same VPC.

Route Tables

  • One route table is attached to a subnet, but multiple route tables can be created in VPC, unlike IGW.
  • Every VPC has a virtual routing device called the VPC router.
  • A router has a collection (route table) of rules. A route contains a destination and a target.
  • Route Table is a set of rules, called routes.
    • By default, all subnets’ traffic is allowed within a VPC, which is called a local route.
    • If multiple routes apply, the most specific one is chosen (/32 is chosen before /24).
    • A default route ( or ::/0) can be added that match any traffic not already matched.
  • The default VPC already has a main route table: local route + IGW
Main route table of the default VPC

Public Subnets

  • Subnets can be public or private.
  • A subnet is public when
    • (1) The subnet has a public IP or EIP; You can modify auto-assign IP settings for a subnet.
    • (2) VPC has an Internet Gateway.
    • (3) The subnet has a route to send all non-local traffic to the Internet Gateway.
    • And (4) Network ACL and security groups allow sending and receiving traffic from the Internet.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s