AWS - VPC and networking

What is VPC?

  1. Virtual network dedicated for your AWS account
  2. Isolated from other networks in AWS
  3. Virtual network resembles a Traditional network
  4. Launch AWS resources, like EC2 instances into your VPC

What is Subnet?

  1. Subnet is a small network within a VPC
  2. Subnet is a Range of IP addresses in your VPC
  3. We can multiple Subnets within a Single VPC
  4. We can launch AWS resources into a Subnet that we select
  5. Use a Public Subnet for Resources that are connected to Internet
  6. Use a Private Subnet for Resources that are connected to Internet

What is Routing Table?

  1. A Route table contains a Set of Rules, called Routes
  2. Routes are used to determine where network traffic is directed
  3. Each Subnet comes with a default Routing table
  4. Each Subnet must be associated with a Route table - this table controls the routing for the Subnet
  5. A subnet can be associated with Only one Route table
  6. We can associate Multiple Subnets with the same Route table

What is Internet Gateway?

  1. Virtual router that connects a VPC to the Internet
  2. A IGW [router] is horizontally scalable, highly available VPN component
  3. VPC is a high broad network and public traffic will pass through IGW
  4. IGW allows communication between instances in your VPC and the Internet
  5. Provide a target in your VPC route tables for Internet-routable traffic
  6. Perform network address translation(NAT) for instances that have been assigned public IP addresses

Create VPC -> Subnets -> EC2

Attach an Internet gateway to a VPC to enable communication with the Internet. Now our VPC got the Internet connection.

Route Table = specifies how packets are forwarded between the Subnets within your VPC, the Internet and your VPN connection.

2 Routing Tables are attached to VPC

2 new Routing tables - one for Public Subnet and one for Private Subnet.

Public Subnet - own routing table

Private Subnet -own routing table

Decide which Subnet will be attached to Internet Gateway? Public Subnet

How to config Subnet and Route table

Edit the Route table - of the [Public] Subnet = Internet gateway

[ Private ] Subnet -> Route table -> Set new Route

[ Public ] Subnet -> Route table -> Set new Route ->

Destination Target IGW

Save the New route of the Route table for the [Public] Subnet

Source :