Prepared by: Anwer Sadath Abdhul Muttaliff
This project demonstrates how to create a Virtual Private Cloud (VPC) with one public and one private subnet, configure an Internet Gateway and a NAT Gateway, and launch EC2 instances in both subnets. The setup ensures secure and functional network architecture.
Go to the VPC Dashboard and create a VPC with the following settings:
my-vpc-test
10.0.0.0/16
Create a public and private subnet within the VPC:
Launch an EC2 instance in the public subnet with the following settings:
my-public-instance
public-subnet
Create an Internet Gateway and attach it to the VPC to enable internet access for the public subnet.
Create separate route tables for the public and private subnets.
Associate the public route table with the public subnet and the private route table with the private subnet.
Add a route to the public route table to allow internet access via the Internet Gateway.
Launch an EC2 instance in the private subnet with the following settings:
my-private-instance
private-subnet
Create a NAT Gateway in the public subnet to allow private subnet instances to access the internet.
Add a route to the private route table to allow internet access via the NAT Gateway.
SSH into the public instance and use it to access the private instance. Verify that the private instance can access the internet for updates.
sudo yum update -y
By following these steps, you have successfully set up a VPC with public and private subnets, configured Internet and NAT gateways, and tested connectivity. This setup ensures secure and functional network architecture in AWS.
Back to Top Back to Home