Contents

NAT Gateway vs Internet Gateway: What's the Difference and When to Use Each

NAT gateway vs internet gateway explained: how each routes traffic in a VPC, which subnets need which, and the cost and security trade-offs in 2026.

An internet gateway is a two-way door between a VPC and the public internet; a NAT gateway is a one-way exit for private resources. If an instance needs to accept inbound connections from the internet, it must sit in a public subnet behind an internet gateway with a public IP or Elastic IP. If it only needs to reach out — package updates, container pulls, external APIs — it sits in a private subnet and sends traffic through a NAT gateway, which rewrites the source address and blocks any inbound connection that wasn't initiated from inside.

That single distinction drives almost every VPC design decision: which subnet a workload lives in, whether it carries a public IP, and what the monthly bill looks like. The two devices are not alternatives to each other — most production architectures run both at once, with an internet gateway serving load balancers and bastion hosts while NAT gateways handle outbound traffic from application and database tiers. Getting the split right is the difference between a clean attack surface and a sprawling one.

Key points

  • An internet gateway gives a VPC two-way public access and needs public IPs on the instances that use it; a NAT gateway gives private subnets outbound-only access with no inbound path.
  • Most production VPCs run both: internet gateway for load balancers and bastion hosts, NAT gateways for application and container tiers in private subnets.
  • NAT gateways are zone-scoped and billed hourly plus per GB processed, so multi-AZ resilience and chatty workloads both raise the bill — model it before you build.
  • For IPv6, an egress-only internet gateway replaces NAT; a transit gateway connects networks but does not provide internet access on its own.

What an internet gateway actually does

An internet gateway is a horizontally scaled, redundant, highly available VPC component that connects a VPC to the internet. It behaves like a virtual router: traffic from a public subnet is routed to the gateway, and the gateway forwards it out. Three conditions must all be true before an instance can use it — the instance lives in a public subnet, the subnet's route table has a route to the internet gateway, and the instance has a public IP or Elastic IP attached.

Because the gateway itself is managed and redundant, it does not appear as a bottleneck or a single point of failure, and AWS does not bill for the gateway component itself. What you pay for is the public IPv4 address attached to the instance, plus any data transfer out. That is why "free internet gateway" is only half true in practice.

  • Supports inbound and outbound traffic in both directions
  • Requires a public subnet, a route to the gateway, and a public or Elastic IP
  • Commonly fronts web servers, public APIs, load balancers and bastion hosts
  • No per-hour charge for the gateway; public IPv4 addresses and egress are billed
50100 GB90500 GB1301,000 GB2102,000 GB4505,000 GB
Example: monthly NAT gateway cost by data processed (one gateway, illustrative rates) (USD per month)

What a NAT gateway actually does

A NAT gateway lets instances in a private subnet reach the internet or other services without exposing themselves. The instance sends traffic to the NAT gateway, which translates the private source address to its own public address, forwards the request, and maps the response back. Connections can only start from inside; the internet cannot open a connection to a private instance through a NAT gateway.

This is the standard pattern for backend servers, container workloads and internal services that need to install updates, pull images or call external APIs while staying unreachable from outside. The mechanics are the same network address translation used on home routers, just applied at VPC scale — the Wikipedia entry on NAT covers the underlying address and port mapping behaviour.

The catch is placement and cost. A NAT gateway lives in a specific subnet and Availability Zone, so a resilient design needs one per zone, and each one carries an hourly charge plus a per-gigabyte data processing fee. Our breakdown of AWS NAT gateway hourly and data processing costs shows how quickly that adds up for image-heavy or API-chatty workloads.

  • Outbound-only: no inbound connections from the internet
  • Used by private subnets for updates, image pulls and external API calls
  • Zone-scoped, so multi-AZ designs need a NAT gateway in each zone
  • Billed hourly plus per GB processed, unlike the internet gateway itself
Example: worked gateway sizing and cost model for a two-zone VPC (illustrative rates)
Design choiceGatewaysZones coveredExample monthly cost (USD)
Internet gateway only, all instances public110
NAT gateway in one zone only1135
NAT gateway per zone, two zones2270
NAT gateway per zone, three zones33105

NAT gateway vs internet gateway: side-by-side

The table below compares the two on the dimensions that actually change an architecture decision. Note that "direction" and "public IP required" are the two rows that dictate subnet placement; cost follows from those choices rather than leading them.

How they work together in a real VPC

A typical production layout puts an Application Load Balancer and the NAT gateway in the public subnet, application servers and container workloads in private subnets, and databases deeper still. Users hit the load balancer through the internet gateway; the private application servers reach out through the NAT gateway for updates and third-party APIs; nothing in the private tier is directly addressable from outside.

AWS documents this combined pattern for architectures that also include a network firewall, adding a NAT gateway only where NAT capability is genuinely needed so you can reduce load and cost. The same principle applies without a firewall: put NAT where private workloads actually egress, not everywhere by default. If you are still mapping subnets and route tables, the CIDR cheat sheet helps size the public and private ranges before you build.

  • Public subnet: load balancer, NAT gateway, bastion host, internet gateway route
  • Private subnet: application and container workloads, route to the NAT gateway
  • Isolated subnet: databases with no internet route at all
  • Route tables, not security groups, decide which gateway a subnet can reach

Where the money goes: egress and NAT processing

Internet gateway traffic is billed as data transfer out at standard rates, while NAT gateway traffic is billed twice in effect — once for the hourly NAT charge and once for data processing through it, on top of any egress. A server that pulls large container images on every deploy, or calls a chatty external API thousands of times an hour, will show a NAT line item that surprises teams who budgeted only for compute and storage.

Two fixes dominate. First, keep bulk traffic off NAT: serve static assets through a CDN, use VPC endpoints or private connectivity for services that support it, and cache external API responses. Second, right-size the number of NAT gateways — one per zone for production resilience is defensible, three per zone across a dozen VPCs usually is not. Running the numbers before you build is cheaper than discovering them on the invoice; the cloud hosting cost calculator lets you model gateway, compute and transfer costs together.

  • Consolidate VPCs or share NAT where compliance allows
  • Move static and cacheable traffic to a CDN
  • Use private connectivity for supported AWS and third-party services
  • Watch per-GB processing on image pulls, log shipping and API polling

Egress-only and transit gateways: the variants worth knowing

IPv6 changes the picture. An egress-only internet gateway does for IPv6 what a NAT gateway does for IPv4 — outbound-only access for private resources — but without address translation, because IPv6 addresses do not need to be hidden behind a shared public address. If you are dual-stacking a VPC, this is the component that replaces NAT on the v6 side.

Transit gateway solves a different problem: connecting many VPCs, on-premises networks and accounts through a single hub instead of a mesh of peerings. It is not a substitute for either gateway — traffic still exits to the internet through an internet gateway or NAT gateway somewhere in the topology. Teams often confuse the three because all appear in the same console section; the decision tree is simply: public access → internet gateway, private outbound → NAT (or egress-only for IPv6), many-network routing → transit gateway.

  • Egress-only internet gateway: IPv6, outbound-only, no translation
  • Transit gateway: hub routing across VPCs and on-premises, not internet access itself
  • NAT gateway: IPv4 outbound for private subnets
  • Internet gateway: bidirectional public access for a VPC

Common misconfigurations to avoid

The most frequent mistake is putting an application server in a public subnet with a public IP "just to make updates work." That trades a small NAT bill for a directly reachable host, and the security group becomes the only thing standing between it and the internet. The reverse error — routing a private subnet straight to an internet gateway — simply fails, because the gateway will not forward traffic for instances without public addresses.

Second on the list is a single NAT gateway serving subnets in multiple Availability Zones. It works, but it creates a cross-zone dependency and a single point of failure for every private workload. Third is forgetting that NAT gateways are zone-bound when scaling: adding a new zone means adding a gateway there too. Before you finalise the design, run through the cloud hosting security checklist to confirm private tiers have no unintended internet paths.

  • Do not give backend servers public IPs to "fix" outbound access
  • Do not point private subnet route tables at an internet gateway
  • Deploy one NAT gateway per Availability Zone for production
  • Audit route tables after every new subnet or VPC peering

Frequently asked questions

Is NAT gateway the same as internet gateway? No. An internet gateway connects a VPC to the internet in both directions and requires instances to have public or Elastic IPs in a public subnet. A NAT gateway lets instances in private subnets reach the internet outbound only, translating their addresses so they stay unreachable from outside.

What is the purpose of a NAT gateway? It gives private resources outbound internet access — software updates, container image pulls, external API calls — without exposing them to inbound connections. It performs address translation so many private instances share the gateway's public address, and it keeps backend tiers off the public attack surface.

What are the limitations of a NAT gateway? It is outbound-only, so it cannot accept inbound connections, and it is bound to a single subnet and Availability Zone, so resilient designs need one per zone. It also adds cost through an hourly charge plus per-GB data processing, and it does not translate IPv6 traffic — that requires an egress-only internet gateway instead.

Alex Morgan

Senior Cloud Consultant

Alex has over a decade of experience helping businesses migrate to and optimize cloud infrastructure. He writes about practical cloud hosting strategies and cost management. His focus is on making cloud technology accessible to small and medium enterprises.

Cloud Hosting Cost Calculator

Cookie Preferences

Required for the site to function, such as remembering your cookie consent choice.

Not used on this site.

Not used on this site.