NAT Gateway vs. Internet Gateway in AWS: Easy Guide

Kalana Hettiarachchi
2 min readNov 17, 2023

--

Igw vs natgw

When you’re using AWS, it’s good to know the difference between a NAT Gateway and an Internet Gateway. Think of them as special doors in the cloud that connect your private space to the big world of the internet.

Internet Gateway: Your Main Door to the Internet

An Internet Gateway is like the front door of your house. It lets you send and receive data to and from the internet. If you have something in your AWS, like a website, that everyone needs to see or use, it uses this gateway.

NAT Gateway: A Secret Path for Safety

The NAT (Network Address Translation) Gateway is more like a secret back door. It's used when your AWS resources need to get things from the internet but don’t want to be seen. For example, if you have a database that needs updates from the internet but should stay hidden, you use this gateway. It makes sure your private stuff can reach out to the internet without being reached from the outside.

Main Differences

1. Traffic Direction: The Internet Gateway is like a two-way road – data can go in and out. The NAT Gateway is a one-way path – data only goes out.

2. Usage:
- Internet Gateway: For things that need to show up on the internet or talk to the internet.
- NAT Gateway: For things that only need to use the internet without being seen.

3. Place in the AWS:
- Internet Gateway: Used with public parts of your AWS.
- NAT Gateway: Used with private, hidden parts.

4. Safety: The NAT Gateway keeps your private stuff safe because it can’t be directly reached from the internet.

So, in short, the Internet Gateway is your main connection to the internet world, and the NAT Gateway is a safe, one-way path for your private AWS parts to use the internet without being exposed. Knowing this helps you make your cloud setup better and safer.

Image reference:

https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/NATgateway.htm

--

--