VPC Configuration - NNN
VPC Configuration - NNN
Public Subnets:
1. Name: public-subnet-1 | AZ: us-east-1a | CIDR: 10.0.1.0/24
2. Name: public-subnet-2 | AZ: us-east-1b | CIDR: 10.0.2.0/24
Private Subnets:
1. Name: private-subnet-1 | AZ: us-east-1a | CIDR: 10.0.3.0/24
2. Name: private-subnet-2 | AZ: us-east-1b | CIDR: 10.0.4.0/24
Go to Subnets → Create subnet, choose your VPC and add them one by one.
Summary
VPC setup includes:
- Custom VPC: 10.0.0.0/16
- 2 Public Subnets + IGW + Route Table
- 2 Private Subnets + NAT Gateway + Route Table
Default VPC
• Private subnets
• Public subnets
-go to subnets
And -go to action, select our VPC after to get attached our VPC
We create ROUNDTABLES
We will create round table for public and private and select our VPC while we creating
PUBLIC
PRIVATE
Click the public route tables – go to routes – edit routes – add routes – and select the
Internet gateway – select the Internet gateway ID – and set the public IP 0.0.0.0/0
Customize your inbound rules for public SG ex; HTTP, HTTPS, RDP, SSH
Go to – inbound rules – click the source – select the PUBLIC SG – select the ALL TCP and
click create SG
We will create EC2 INSTANES
Select your key pair – edit networking – select your VPC – select your public subnet – enable
auto assign IP – edit your fire wall – select your public SG – Launch instance
PUBLIC INSTANCE
Create private instance – as same as creating public instance
But select your private subnets – disable auto assign IP – select your private SG – Launch
instance
PRIVATE INSTANCE
Creating NAT GATEWAY
Go to create – name your NAT gateway – select your public subnets – click you Elastic
allocate IP – create Nat gateway
Through SSH
Generated password – copy your Private IP address – Go to your PUBLIC EC2 machine –
Select Remote desktop – paste your IP address inside of your public machine and user name
and password
Successfully launched private ec2 inside of public ec2 with internet connecting for using
NAT gateway
THANK YOU