Monday, 15 April 2024

The goal of this lab is to demonstrate how to access an EC2 instance launched in a private subnet using a bastion host.

 

Architecture Diagram

lab-002-arch-01

Overview

In order to achieve the goal of this lab, you will have to go through the following steps:

Step 1 - Create VPC

Create a new VPC with the Name tag lab-002 and the IPv4 CIDR block 192.168.0.0/16.

lab-002-scrn-01 lab-002-scrn-02 lab-002-scrn-03

Step 2 - Create an Internet Gateway

Create an Internet gateway with the Name tag lab-002 and attach it to lab-002 VPC.

lab-002-scrn-04 lab-002-scrn-05 lab-002-scrn-06 lab-002-scrn-07 lab-002-scrn-08

Step 3 - Create the Public Subnet

Create a public subnet on lab-002 VPC with the Name tag public and IPv4 CIDR block 192.168.100.0/24.

lab-002-scrn-09 lab-002-scrn-10 lab-002-scrn-11

Step 4 - Enable Auto-assign IPv4

Enable Auto-assign IPv4 in the newly created public subnet.

lab-002-scrn-12 lab-002-scrn-13

Step 5 - Create a Route Table

Create a new route table with the Name tag public and with a default route to the internet gateway created in step 2.

lab-002-scrn-14 lab-002-scrn-15 lab-002-scrn-16 lab-002-scrn-17 lab-002-scrn-18 lab-002-scrn-19 lab-002-scrn-20 lab-002-scrn-21

Step 6 - Associate the Route Table to the Public Subnet

Associate the newly created route table to the public subnet.

lab-002-scrn-22 lab-002-scrn-23

Step 7 - Create the Private Subnet

Create a private subnet on lab-002 VPC with the Name tag private and the IPv4 CIDR block 192.168.200.0/24.

lab-002-scrn-24 lab-002-scrn-25 lab-002-scrn-26

Step 8 - Launch the EC2 Instances

Launch two EC2 instances using the procedure described in lab-001; make sure that each subnet has one of the instances.

Note that the EC2 instance that you will create in the public subnet (labeled as A in the diagram) is necessary so you can later connect to the EC2 instance in the private subnet (labeled as B in the diagram). EC2 A is normally called bastion host or jump host.

No comments:

Post a Comment