This lab walks you through the steps to create a NAT Gateway and allow internet access to an Instance in a private subnet.
Duration: 45 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 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 subnet and attached Internet Gateway to public subnet.
Create EC2 instances for each public and private subnet.
SSH and test the internet access from an instance in private subnet.
To provide internet access to the Instance in the private subnet, create a NAT Gateway and attach it to the VPC.
Attach NAT Gateway to correct route table.