Lab 10 2 VPC From Scratch - nicolas-tullio/Tech-Journal GitHub Wiki
Deliverables
New VPC Details

New Subnet Details


New Routing Table Details


Pings from Private Instance (success to Public, Fail to Internet)

Pings from Public Instance (success to Private, Success to Internet)

Steps
VPC Configuration
Navigate to VPC > Your VPCs

Click on Create VPC
- Name tag:
testVPC
- IPv4 CIDR block:
10.0.0.0/16
- IPv6 CIDR block: No need to change this, make sure No IPv6 CIDR Block is checked.
- Tenancy: No need to change this, make sure Default is selected.
- Now click on Create VPC

Once VPC is created, click on Your VPCs

Subnet Configuration
For the Public Subnet, click on Subnets from the left menu and click on Create subnet.
- VPC: Select
testVPC
from the list you created earlier.
- Name tag:
PublicSubnet
- Availability Zone: Select
us-east-1a
- IPv4 CIDR block: Enter the range
10.0.1.0/24
- Click on Create subnet

For the Private Subnet, click on Subnets from the left menu and click on Create subnet.
- VPC: Select
testVPC
from the list you created earlier.
- Name tag:
PrivateSubnet
- Availability Zone: Select
us-east-1b
- IPv4 CIDR block: Enter the range
10.0.2.0/24
- Click on Create subnet

Create and configure Internet Gateway
Click on Internet Gateways from the left menu and click on Create internet gateway

Select the Internet gateway you created from the list

- Click on Actions
- Click on Attach to VPC
- Select test which you created from the list and click on Attach internet gateway

Create Route Tables
Go to Route Tables from the left menu and click on Create route table
- Name Tag:
PublicRouteTable
- VPC: Select
testVPC
from the list.
- Click on Create

Repeat the same steps to create a route table for the RDS database tier (Private Subnet)
- Name Tag:
PrivateRouteTable
- VPC: Select
testVPC
from the list
- Click on Create


Associate the public subnet to the public route table
Select PublicRouteTable
and go to the Subnet Associations tab
Click on Edit subnet associations

Select PublicSubnet
from the list and save

Associate the private subnet to the private route table
Select PrivateRouteTable
and go to the Subnet Associations tab
Click on Edit subnet associations

Select PrivateSubnet
from the list and save

PublicRouteTable: Add a route to allow Internet traffic to the VPC.
- Select
PublicRouteTable
from the list.
- Go to Routes tab, click on Edit routes

Specify the following values:
- Destination:
0.0.0.0/0
- Target: Select Internet Gateway from the dropdown menu to select
IGW
- Click save


EC2 Instances
Launch 2 Free-Tier EC2 instances
Make sure to assign your new VPC and subnets when configuring
One on Public Subnet
- For this instance - make sure to "enable" auto assign Public IP

One on Private Subnet
- For this instance - leave auto-assign IP as disabled

SSH into your Public Instance with your private key

Use scp to copy your aws ssh key to the Public instance

You should then be able to SSH from the Public Instance to the Private Instance

The Private Instance should be able to ping the Public Instance but not the Internet (Screenshot)

The Public Instance should be able to ping Private Instance and the Internet (Screenshot)
