Introduction
In AWS, an Internet Gateway (IGW) connects a VPC to the public internet and enables two-way communication (both inbound and outbound). A NAT Gateway (NGW) allows resources in private subnets to access the internet outbound only, while keeping them inaccessible from the public internet.

Internet Gateway (IGW)
An Internet Gateway acts as a bridge between your VPC and the internet. It is a horizontally scaled, highly available, AWS-managed component that provides direct internet connectivity for resources within a VPC. Internet Gateways are free to use (there is no hourly charge).
Key Features of an Internet Gateway (IGW)
Enables both inbound and outbound internet traffic.
Primarily used with public subnets.
Instances must have a public IPv4 address or an Elastic IP to communicate with the internet.
Commonly used for web servers, bastion hosts, and other public-facing applications.
NAT Gateway
A NAT (Network Address Translation) Gateway enables instances in private subnets to access the internet outbound only, while preventing any inbound connections from the internet. The traffic flow is outbound only, effectively blocking unsolicited inbound traffic.
Instances private subnets use private IP addresses, and the NAT Gateway translates these to a public IP address for outbound internet access. NAT Gateways are charged on an hourly basis, along with data processing fees.
Key Features of an Internet Gateway (IGW)
Enables two-way internet connectivity (both inbound and outbound traffic).
Allows resources in a VPC to communicate directly with the public internet.
Primarily used with public subnets.
Requires instances to have a public IPv4 address or an Elastic IP.
Horizontally scaled and highly available, managed entirely by AWS.
Acts as a target in route tables for internet-bound traffic (0.0.0.0/0).
Free to use (no hourly cost; standard data transfer charges may apply).
Commonly used for web servers, bastion hosts, and public-facing applications.
Comparison Table
| Feature | Internet Gateway (IGW) | NAT Gateway (NGW) |
|---|---|---|
| Traffic Direction | Inbound + Outbound | Outbound only |
| Subnet Type | Public IP / Elastic IP | Private IPs only |
| Use Case | Public-facing apps | Secure backend access |
| Security | Exposes resources to the internet | Keeps resources private |
| Cost | Free | Hourly + data fees |
| IPv6 Support | Yes | IPv4 only |
| Public IP Required | Yes (for instance) | Yes (Elastic IP) |
Summary
In this article, we explored the Internet Gateway and NAT Gateway in AWS, along with their key features. In the following article, we will focus on configuring the Internet Gateway and NAT Gateway in AWS.

Join the conversation! Your thoughts help the community grow.