This lab walks you through the steps to create a NAT Gateway and allow internet access to an Instance in a private subnet.
Duration: 1 hour 30 minutes
AWS Region: US East (N. Virginia) us-east-1
NAT stands for Network Address Translation.
A NAT Gateway is a device used to enable instances in a private subnet to connect to the internet or other AWS services.
It prevents the internet from initiating connections with the instances present in the private subnet.
It forwards traffic from the instance in the private subnet to the internet or other AWS services, and then sends the response back to the instances.
Changes the instances IP address with the NAT device's address when the traffic goes to the Internet.
We have 2 kinds of NAT devices:
NAT Instance
NAT Gateway
NAT Instance uses Amazon Linux AMIs.
NAT Instance limit depends on your instance type limit for the region.
NAT Instance does not support IPv6 traffic.
NAT Gateway usage is charged to the customer on an hourly basis.
NAT Gateway does not support IPv6 traffic.
AWS recommends the usage of NAT Gateway, since they provide better availability and bandwidth over NAT Instances.
Log into AWS Management Console.
Create a VPC.
Create public and private subnets.
Create Internet Gateway
Create Public route table and configure
Launch an EC2 instance in Public subnet.
Launch an EC2 instance in Private subnet.
SSH into Public and Private EC2 instance and Test Internet Connectivity
Create a NAT Gateway
Update Route table and configure NAT Gateway
Test Internet connection from Instance inside Private Subnet
Validation of the lab.