# Network Address Translation

Network Address Translation rewrites IP addresses, and sometimes transport-layer ports, as packets move between networks.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/network-address-translation

> Network Address Translation allows workloads to communicate using addresses different from those assigned to their network interfaces. Cloud architectures commonly use it to give private workloads outbound IPv4 connectivity, conserve public addresses, or connect networks that require address remapping.

Practice exams covering Network Address Translation: [ANS-C01 AWS Certified Advanced Networking - Specialty](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty), [CLF-C02 AWS Certified Cloud Practitioner](https://blowstack.com/practice-exams/aws-certified-cloud-practitioner), [SOA-C03 AWS Certified CloudOps Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate), [DEA-C01 AWS Certified Data Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate), [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate), [SAA-C03 AWS Certified Solutions Architect - Associate](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate), [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

## 7 key aspects of Network Address Translation

Effective NAT design combines correct translation and routing with independent security controls, sufficient capacity, resilient placement, and cost-aware traffic paths.

1. **Address rewriting and connection mappings**: NAT changes source or destination addresses; implementations that also translate ports can share an address across many workloads. Stateful mappings allow return traffic to reach the original sender.
2. **Explicit forward and return paths**: NAT only works when route tables direct traffic through the translator and responses return through a compatible translation path. Creating a gateway does not automatically configure workload routing.
3. **Connectivity is distinct from security**: Outbound NAT commonly prevents unsolicited inbound connections, but it does not inspect application intent or replace access controls. Apply workload security groups, subnet network ACLs, and any required egress filtering separately.
4. **Availability and scaling boundaries**: Translation devices have connection, port, and throughput limits. For zonal deployments, same-zone gateways reduce cross-zone dependencies, while self-managed instances require explicit capacity planning and failover.
5. **Total-cost optimization**: Compare fixed gateway or instance costs, data processing, transfer, public addresses, and operational work. Use private service endpoints when their connectivity and pricing provide a better alternative to the NAT path.
6. **Observable failure modes**: Broken routes, blocked return ports, failed DNS resolution, and exhausted translation mappings can produce similar application symptoms. Correlate route inspection, flow logs, and gateway metrics rather than assuming every timeout is a firewall problem.
7. **IPv4 and IPv6 require different designs**: Private IPv4 workloads commonly use NAT for internet access, while IPv6 workloads can use globally routable addresses with appropriate controls. Egress-only IPv6 gateways do not translate addresses; NAT64 specifically bridges IPv6 clients to IPv4 destinations.

## Cloud services for Network Address Translation

Amazon VPC supplies the routing and network controls around a translation path. Private-subnet routes can send outbound IPv4 traffic to a public NAT gateway, whose subnet reaches an internet gateway; security groups and network ACLs independently control permitted traffic. Amazon EC2 provides an alternative implementation through a self-managed NAT instance when custom behavior or a carefully evaluated cost advantage justifies the maintenance burden.

CloudWatch metrics and VPC Flow Logs help distinguish translation-capacity problems from routing or filtering failures. VPC endpoints can remove supported service traffic from the NAT path, reducing processed data and external connectivity dependencies. Choose endpoint types and gateway placement using both availability requirements and the complete traffic-cost model.

- **[Amazon VPC](https://blowstack.com/tools/cloud-services-hub/amazon-vpc)**: Provides the subnets, route tables, internet gateways, network ACLs, and security groups that determine how translated traffic flows. Its gateway and interface endpoints can provide alternative paths that avoid NAT for supported service traffic.
- **[Amazon EC2](https://blowstack.com/tools/cloud-services-hub/amazon-ec2)**: Can host a self-managed NAT instance using operating-system forwarding and translation rules. This requires disabling source/destination checks and managing security groups, patching, capacity, and failover.
- **[Amazon CloudWatch](https://blowstack.com/tools/cloud-services-hub/amazon-cloudwatch)**: Exposes NAT gateway metrics for traffic, connection activity, packet drops, and port allocation errors. CloudWatch Logs can also receive VPC Flow Logs to support investigation of routing and filtering symptoms.

## Network Address Translation exam questions

Real practice exam questions on Network Address Translation, with the correct answer and its explanation.

### Question 1 (CLF-C02)

**Question:**

An Amazon EC2 worker in a private subnet submits jobs to an external processing service over HTTPS through a correctly configured public NAT gateway. The service immediately acknowledges each submission, but later attempts to open a new HTTPS connection to the worker to deliver the completed result. These delivery attempts fail. The worker must remain accessible only through private IP addresses, and no new inbound connectivity may be added. Which change will allow the worker to obtain completed results?

**Correct answer:** Configure the worker to periodically request completed results from the external service over HTTPS.

**Explanation:** The worker can initiate requests through the NAT gateway and receive results as response traffic. This avoids requiring the external service to initiate a new inbound connection to the worker.

### Question 2 (SOA-C03)

**Question:**

A company runs EC2 instances with only private IPv4 addresses in a VPC with CIDR block 10.30.0.0/16. The instances access the internet through an existing public NAT gateway that has private IPv4 address 10.30.1.25 and an Elastic IP address. An external API allowlists the Elastic IP address.

The company adds connectivity to a corporate HTTPS service at 172.20.10.40 through an AWS Site-to-Site VPN connection. The instance subnet routes 172.20.0.0/16 to the existing NAT gateway. The NAT gateway's subnet routes 172.20.0.0/16 to the virtual private gateway and routes 0.0.0.0/0 to the internet gateway. The corporate network has a return route for 10.30.0.0/16 through the VPN.

The corporate firewall allows HTTPS only from the NAT gateway's Elastic IP address, but the connections fail. VPC security groups and network ACLs permit the traffic. The company must retain the VPN path and the external API's existing allowlist configuration.

Which change will allow the instances to reach the corporate service?

**Correct answer:** Change the corporate firewall rule to allow HTTPS from 10.30.1.25 instead of the NAT gateway's Elastic IP address.

**Explanation:** The NAT gateway translates the instances' source addresses to its private IPv4 address. Its Elastic IP address is used for internet connectivity through the internet gateway, not for traffic sent through the virtual private gateway. The corporate service therefore sees 10.30.1.25 as the source. Updating the corporate firewall preserves both the VPN path and the existing internet configuration.

### Question 3 (SAP-C03)

**Question:**

A company runs a batch-processing platform in private subnets across three Availability Zones in one VPC. The workers exchange 9,000 GB each month with an external vendor's IPv4-only HTTPS endpoint, with traffic evenly distributed across the Availability Zones. This volume includes requests and responses. The vendor does not support private connectivity, and security policy prohibits public IP addresses on workers.

All workers run during 20 scheduled processing windows each month. Each window requires NAT connectivity for exactly 5 billable hours, including provisioning and cleanup time. No workloads require internet connectivity outside these windows. Existing automation can create NAT gateways, update routes before processing begins, and delete the gateways after processing finishes. The company accepts processing interruptions during an Availability Zone failure, so a shared NAT gateway is permitted.

Use the following pricing assumptions:
• NAT gateway availability: $0.045 per gateway-hour.
• NAT gateway data processing: $0.045 per GB, including downloaded data.
• Traffic between workers and a NAT gateway in another Availability Zone: an additional combined charge of $0.02 per GB.
• A month contains 730 hours.

Ignore all other charges. Which configuration provides the LOWEST monthly network cost?

**Correct answer:** For each processing window, create one NAT gateway in each Availability Zone and route each private subnet through its local gateway. Delete all three gateways after the window.

**Explanation:** This configuration minimizes billable gateway-hours without introducing cross-Availability Zone traffic. There are 20 × 5 = 100 billable hours per gateway. The monthly cost is (3 × 100 × $0.045) + (9,000 × $0.045) = $418.50, the lowest of the proposed configurations. Deleting idle gateways eliminates their availability charges, but all 9,000 GB still incurs NAT processing charges.

### Question 4 (DEA-C01)

**Question:**

A company runs ingestion workers in private subnets in an Amazon VPC. The workers previously retrieved data from a partner's public database endpoint. Their outbound traffic passes through a public NAT gateway with private IPv4 address 10.20.1.10 and Elastic IP address 198.51.100.40.

The partner moves the database to private IPv4 address 172.30.4.25, reachable through an AWS Site-to-Site VPN connection attached to a transit gateway. The worker subnet route tables send traffic for the partner's network to the existing NAT gateway. The NAT gateway's subnet route table sends that traffic to the transit gateway, not to an internet gateway. All routes, return paths, security groups, and network ACLs are correctly configured.

The partner's firewall still allows database connections only from 198.51.100.40/32, so ingestion connections fail. The partner requires a single source IPv4 /32 entry that supports all workers, whose private addresses can change. Which source should replace the existing firewall allowlist entry?

**Correct answer:** 10.20.1.10/32, the NAT gateway's private IPv4 address

**Explanation:** When traffic from a public NAT gateway reaches a destination through a transit gateway rather than an internet gateway, the destination sees the NAT gateway's private IPv4 address. Allowlisting 10.20.1.10/32 therefore permits connections from all workers using this path despite changes to their individual addresses.

### Question 5 (ANS-C01)

**Question:**

A company acquires a business whose VPC uses the same IPv4 CIDR block, 10.60.0.0/16, as the company's application VPC. The VPCs are in separate AWS accounts in the same Region, and some application servers have identical IP addresses. Neither VPC can be renumbered.

Selected servers in either VPC must initiate private TCP and UDP connections to individual servers in the other VPC, including connections for which no previous session exists. Application proxies and load balancers are not permitted. Applications can use unique alias IP addresses for remote servers, and preserving original source IP addresses is not required.

The network team can add a different, nonoverlapping secondary CIDR block to each VPC and connect both VPCs to a transit gateway. Which design meets these requirements?

**Correct answer:** Deploy NAT appliances in both VPCs with static, bidirectional mappings between selected servers and unique addresses from their VPC's secondary CIDR block. Translate locally initiated traffic's source to its server alias, and translate incoming traffic's destination alias to the local server address. Disable source/destination checking on the appliances, route both directions through them, and configure transit gateway routing for the unique alias ranges rather than the overlapping ranges.

**Explanation:** Static bidirectional mappings support new connections initiated from either VPC. Source translation ensures that the remote VPC sees a unique, routable sender address, while destination translation delivers traffic addressed to an alias to the corresponding original server. Routing through the appliances in both directions allows reverse translation, and the transit gateway carries only unambiguous alias addresses.

### Question 6 (DVA-C02)

**Question:**

A developer configures an AWS Lambda function to use private subnets in a VPC so that it can call an internal inventory service. The function successfully calls the internal service, but calls to a third-party HTTPS API now time out. The third-party API is available only through a public IPv4 endpoint and does not support AWS PrivateLink. DNS resolution succeeds, and security groups and network ACLs allow the required traffic. The private subnet route tables contain only the VPC local route. The VPC also has a public subnet with a route to an internet gateway.

Which change will allow the function to call both services?

**Correct answer:** Create a public NAT gateway with an Elastic IP address in the public subnet. Add a default IPv4 route to that NAT gateway in the route tables associated with the function's private subnets.

**Explanation:** The public NAT gateway provides outbound IPv4 internet connectivity for the function's private addresses. The public subnet's internet gateway route completes the internet path. The existing VPC local route continues to carry traffic to the internal inventory service.

### Question 7 (SAA-C03)

**Question:**

A company runs IPv4-only EC2 workers in private subnets in one Availability Zone. The workers use an existing zonal public NAT gateway in the same Availability Zone to access internet repositories. The NAT gateway must remain in place for this access.

The VPC also has an existing AWS Transit Gateway connection to an on-premises data center. The workers must now initiate connections to an on-premises licensing server. The data center requires all worker connections to appear to originate from one private IPv4 address from the VPC's CIDR block. The VPC and data center address ranges do not overlap. Existing transit gateway and data center routes support return traffic to the VPC CIDR block.

Which solution meets these requirements with the LOWEST additional recurring networking cost?

**Correct answer:** Route licensing-server traffic from the worker subnets through the existing public NAT gateway. In the NAT gateway's subnet route table, route the licensing-server destination through the transit gateway. Allowlist the NAT gateway's private IPv4 address.

**Explanation:** A public NAT gateway can translate traffic destined for a private network through a transit gateway. The licensing server sees the NAT gateway's private IPv4 address because the traffic does not traverse an internet gateway. Reusing the required gateway avoids additional NAT gateway hourly charges while preserving internet access.

## Practice Network Address Translation in a full exam

Questions on Network Address Translation in each practice exam, with every answer option and an explanation for each:

- [SAA-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate): 11 questions
- [SOA-C03](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate): 4 questions
- [SAP-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional): 3 questions
- [ANS-C01](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty): 2 questions
- [CLF-C02](https://blowstack.com/practice-exams/aws-certified-cloud-practitioner): 1 question
- [DEA-C01](https://blowstack.com/practice-exams/aws-certified-data-engineer-associate): 1 question
- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 1 question

## What is Network Address Translation

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.

## Learn Network Address Translation in lessons

9 short lessons on Network Address Translation in 5 certification courses.

- CLF-C02: Network Address Translation: outbound IPv4 connectivity (Premium), https://app.blowstack.com/lessons/network-address-translation-outbound-ipv4-connectivity-clf-c02
- SOA-C03: IP Routing vs Network Address Translation (free), https://app.blowstack.com/lessons/ip-routing-vs-network-address-translation-soa-c03
- SAP-C03: Network Address Translation: cost-aware egress topology (Premium), https://app.blowstack.com/lessons/network-address-translation-cost-aware-egress-topology-sap-c03
- DEA-C01: Network Address Translation: stable outbound source addresses (Premium), https://app.blowstack.com/lessons/network-address-translation-stable-outbound-source-addresses-dea-c01
- SAA-C03: Network Address Translation: private-subnet IPv4 egress (Premium), https://app.blowstack.com/lessons/network-address-translation-private-subnet-ipv4-egress-saa-c03
- CLF-C02: Network Address Translation vs IP Routing (Premium), https://app.blowstack.com/lessons/network-address-translation-vs-ip-routing-clf-c02
