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.

AWS Viki

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)

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)

Comparison Table

FeatureInternet Gateway (IGW)NAT Gateway (NGW)
Traffic DirectionInbound + OutboundOutbound only
Subnet TypePublic IP / Elastic IPPrivate IPs only
Use CasePublic-facing appsSecure backend access
SecurityExposes resources to the internetKeeps resources private
CostFreeHourly + data fees
IPv6 SupportYesIPv4 only
Public IP RequiredYes (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.