Cloud NAT Static IP: Ensuring Consistent Outbound Source IP
An organization has a Cloud NAT configured for a VPC network to allow outbound internet access for private instances. They notice that some instances are failing to connect to a specific external API that requires a static source IP. What should they do to resolve this?
Quick Answer
The answer is to configure Cloud NAT with a static NAT IP address and ensure all traffic uses that IP. This is correct because Cloud NAT by default uses ephemeral IP addresses from a pool, which can change and break connections with external APIs that require a consistent source IP for security or logging purposes. By assigning a static NAT IP, you guarantee that every outbound packet from your private instances will have the same predictable source address, meeting the API’s static source IP requirement without exposing instances to the public internet. On the Google Professional Cloud Network Engineer exam, this scenario tests your understanding of Cloud NAT’s address management and the distinction between ephemeral and static NAT IPs—a common trap is assuming you need to assign public IPs directly to instances. Remember the mnemonic: “Static NAT, consistent path—no IP flip, no API wrath.”
⚠ Common exam trap
Google Cloud often tests the misconception that assigning static external IPs to instances is necessary for static source IP requirements, when in fact Cloud NAT with a static IP achieves the same goal without compromising the private nature of the instances.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Configure Cloud NAT with a static NAT IP address and ensure all traffic uses that IP.
Cloud NAT with a static NAT IP address ensures that all outbound traffic from private instances uses a consistent, predictable source IP. This satisfies the external API's requirement for a static source IP without needing to assign public IPs directly to instances. Option C correctly configures Cloud NAT to use a static IP, which is the intended solution for this scenario.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Private Google Access instead of Cloud NAT.
Why it's wrong here
Private Google Access is for Google APIs and services, not for external APIs.
- ✗
Assign a static external IP to the instances and use Cloud NAT with static IPs.
Why it's wrong here
This option fails because assigning static external IPs directly to instances bypasses the purpose of Cloud NAT, which is to *provide* a static source IP for *multiple* private instances from a single, shared NAT IP. While tempting because it directly addresses the static IP requirement, it's the wrong approach when the goal is to manage outbound access for a group of instances via a central NAT gateway, not to individually assign public IPs.
- ✓
Configure Cloud NAT with a static NAT IP address and ensure all traffic uses that IP.
Why this is correct
This provides a consistent source IP for all outbound traffic, meeting the API's requirement.
- ✗
Use a VPN tunnel to the API provider's network.
Why it's wrong here
A VPN tunnel establishes a private, encrypted connection to the API provider’s network, but it does not alter the source IP address of outbound traffic from the private instances. The requirement is for a static, predictable source IP that the external API can whitelist; a VPN merely routes traffic through a different path without providing a fixed public IP. This option is tempting because VPNs are commonly used for secure site-to-site connectivity, and would be correct if the API provider required private network access rather than a static source IP for firewall rules.
Visual reference
Go deeper
Related to this question
About these practice questions
This PCNE question is part of Courseiva's 961-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on PCNE
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company is using Cloud NAT for outbound internet access. They want to ensure that traffic from certain VMs always uses a specific set of NAT IPs for auditing purposes. Which three steps are necessary to achieve this? (Choose THREE.)
hard- A.Ensure the VMs have a default route (0.0.0.0/0) with next hop set to the Cloud NAT gateway's subnet
- B.Configure IAM conditions on the Cloud NAT resource to restrict which VMs can use it
- ✓ C.Enable VPC Flow Logs on the subnet to monitor which NAT IPs are used
- ✓ D.Create a separate Cloud NAT gateway with the desired IPs and associate it with the VMs via a subnet or tags
- ✓ E.Configure VPC firewall rules to allow egress from the VMs to the internet
Why C: To ensure specific VMs use a designated set of NAT IPs for auditing, you must first create a separate Cloud NAT gateway with the desired IPs and associate it with the VMs via subnet or tags (option D). This isolates traffic from those VMs. Next, configure VPC firewall rules to allow egress from the VMs to the internet (option E); otherwise, outbound traffic may be blocked. Finally, enable VPC Flow Logs on the subnet (option C) to capture which NAT IPs are used, providing auditability. Option A is not necessary because the default route's next hop is the internet gateway, not the NAT gateway's subnet, and Cloud NAT does not require a route pointing to its subnet. Option B is misleading: Cloud NAT uses subnet or tag associations, not IAM conditions, to control which VMs use it.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PCNE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCNE exam.