Network Address Translation, commonly abbreviated NAT, changes source or destination IP addresses as packets cross a network boundary. Source NAT changes the sender's address, while destination NAT changes the receiver's address. Many outbound implementations also translate TCP or UDP ports, allowing multiple private addresses to share one public IPv4 address. A stateful translator records these mappings so that response packets reach the correct originating workload.
For example, an application server at 10.0.2.15 might download operating-system updates from an internet repository. An outbound NAT device replaces the server's private source address with an externally reachable address and may replace its source port. The repository responds to that translated address and port, and the translator reverses the mapping. The application server does not need its own public IPv4 address.
In AWS, a typical design places application servers in private subnets and a public NAT gateway in a public subnet. The private subnet's route table sends internet-bound IPv4 traffic, commonly through a 0.0.0.0/0 route, to the NAT gateway. The gateway's subnet routes internet traffic to an internet gateway, and the public NAT gateway has an Elastic IP address. More precisely, the NAT gateway first translates the workload's source address to its own private address, and the internet gateway maps that address to the Elastic IP. Both routing stages must be correct.
A route to an internet gateway alone does not give an IPv4-only instance with only a private address internet access. Likewise, adding a NAT gateway does not automatically change subnet routes. A private NAT gateway serves a different purpose: it translates traffic toward connected private networks, such as networks reached through a transit gateway or virtual private gateway, rather than providing internet access. Transit gateways provide routing connectivity; they do not automatically translate overlapping addresses.
NAT is not a replacement for security policy. An outbound NAT gateway permits response traffic for connections initiated behind it, but it does not expose arbitrary inbound connections to those workloads. General-purpose NAT implementations can support inbound destination mappings, so NAT as a concept is not synonymous with outbound-only access. Security groups, network ACLs, firewalls, and application authorization remain necessary. AWS NAT gateways do not have security groups; workload security groups and subnet network ACLs still affect connectivity. Security groups are stateful, whereas network ACLs are stateless and must allow the required traffic in both directions.
Availability and performance depend on the implementation. With zonal NAT gateways, placing a gateway in each workload Availability Zone and using same-zone routes avoids depending on another zone and can avoid cross-zone transfer charges. A single shared gateway reduces gateway-hour charges but introduces a shared failure dependency and potentially additional data-transfer costs. NAT instances offer control over software and configuration, but engineers must size them, patch them, disable EC2 source/destination checks, and implement failover. Their connection tracking, CPU, and network capacity can become bottlenecks.
Cost comparisons must include gateway hours, processed data, public IPv4 charges, applicable transfer charges, and operational effort. A small NAT instance can cost less for modest traffic, but it is not operationally equivalent to a managed gateway. Gateway VPC endpoints for Amazon S3 and Amazon DynamoDB can keep eligible traffic off the NAT path. Interface endpoints can also provide private service access, but their hourly and processing charges require a separate comparison.
When troubleshooting, follow the complete forward and return paths. Check route-table associations, gateway availability, internet-gateway attachment, public address assignment, workload security-group egress, and network ACL rules, including ephemeral return ports. Confirm DNS resolution separately from IP connectivity. Use VPC Flow Logs and NAT gateway metrics to investigate rejected traffic, packet drops, or source-port allocation failures. Many simultaneous connections to the same destination can exhaust translation capacity even when bandwidth usage appears low.
IPv6 usually does not require address translation for internet access. In AWS, an egress-only internet gateway supports outbound-initiated IPv6 communication without performing NAT. NAT64 is a separate translation mechanism that allows IPv6 clients to reach IPv4 destinations, often combined with DNS64. Distinguishing ordinary IPv6 routing, outbound-only IPv6 access, and address-family translation prevents incorrect gateway choices.