Deploying Network Address Translation (NAT) Gateway

1 hour
  • 3 Learning Objectives

About this Hands-on Lab

In this lab, you will be deploying a NAT gateway into the public-facing subnet of the solution. Once implemented, you will test connectivity using an EC2 instance.

NAT gateways allow communication to the internet without the sending device requiring a public IP address. Not having a public IP address prevents any communication from the internet into the endpoint.

It is expected you will be familiar with the AWS console to complete this lab and have an understanding of networks and routing.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a NAT Gateway in the Public Subnet

In this objective, we will be deploying a NAT gateway called VPC1NGW in the public subnet of our VPC.

Use the following settings for this objective:

Name = VPC1NGW
Subnet = FirstVPCPublic1UsEast1a-10-0-0-0-24
Connectivity type = Public
Elastic IP allocation ID = Allocate Elastic IP
Modify the Private Route Table So 0.0.0.0/0 Targets the NAT Gateway

In this objective, we will be adding a new route to the private route table, so all traffic not destined for the VPC is sent out to the NAT gateway.

Use the following settings for this objective:

Destination = 0.0.0.0/0

Target = NAT Gateway - VPC1NGW
Test Internet Connectivity from the Private Instance

Now that the NAT gateway has been created and the route table updated, in this objective you will be confirming connectivity to the internet.

Using AWS System Manager – Fleet Manager, open a session to EC2Instance1.

Use the command below to check the IP address EC2Instance1 is using for internet communication:

curl ifconfig.me

Check the returned reponse is the public IP of the VPC1NGW NAT gateway.

Test connectivity with an Internet webpage using the curl command.

Example command:-

curl https://www.bbc.co.uk

Additional Resources

Windyfront Air Conditioning has recently been experiencing unusual activity on one of their application servers. The server does not require direct internet access but does need to communicate with a server on the internet. In this lab, you will be helping Ted to implement a NAT gateway into the solution so the application server may communicate with the internet without having a public IP address of its own.

You will be provided with a single VPC environment with a private and public subnet. An EC2 instance has been provided for you to test the solution in the private subnet.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?