What does a private subnet protect? Design only the outbound paths you need
A private subnet usually lacks a direct path for connections initiated from the internet, but that does not mean its servers cannot reach the internet or cloud services. Inbound connections, outbound connections initiated by a server, and private paths to specific cloud services are different flows and should be designed separately.
A private subnet usually lacks a direct path for connections initiated from the internet, but that does not mean its servers cannot reach the internet or cloud services. Inbound connections, outbound connections initiated by a server, and private paths to specific cloud services are different flows and should be designed separately.
What does “private” mean?
The term is provider-specific. In AWS, a subnet is private when its associated route table has no route to an internet gateway. In Azure, “private subnet” also describes a configuration that does not give VMs implicit default outbound public IP access. In Google Cloud, a VM without an external IP generally cannot send packets outside its VPC by default, but features such as Private Google Access can enable access to eligible services.
Do not infer isolation or safety from the subnet name alone. Check the provider, public addresses, routes and firewall rules. “Private” does not automatically mean air-gapped or secure.
How do inbound, general outbound and private service access differ?
An Internet host initiating a connection to a server is not the same as a server initiating a request outward. A NAT gateway can translate a private source address so a VM can request an update and receive the reply. AWS and Azure document NAT as allowing return traffic for outbound-initiated flows, not unsolicited inbound connections.
NAT is not itself a policy that chooses allowed domains, ports or business purposes. A default route through NAT may still allow many destinations if firewall rules permit them; a route can also exist while a firewall or DNS failure blocks the request. Combine NAT with security groups, network firewalls or proxies when destination filtering or auditing is required.
For a small set of cloud services, a service-specific private path may be narrower. AWS VPC endpoints connect to supported AWS services without an internet gateway or NAT. Google Cloud offers different choices such as Private Google Access for Google APIs and Private Service Connect or private services access for supported services. Azure Private Endpoint connects supported Private Link resources to a private IP in a VNet. None is a general route to every public Internet site; check service support, DNS, routes and access policy.
Internet-initiated request ──X──> private VM
private VM ──> NAT/firewall ──> public Internet service
private VM ──> private service endpoint ──> supported cloud serviceThis is a conceptual diagram. Actual next hops, translation, state tracking and filter placement depend on the provider and configuration.
Which outbound path should you choose?
| Need | First path to consider | Limitation to check |
|---|---|---|
| No external access | Omit general egress; allow only required internal traffic | Check that operations, deployment and monitoring tools do not still require external access. |
| Several public Internet destinations | Explicit egress through NAT or a centralized firewall/proxy | NAT translates addresses; it does not automatically provide a destination allowlist or content inspection. |
| A few cloud APIs or managed services | Their private endpoint or service-specific access feature | Check supported services, endpoint policy, DNS, firewall and service permissions. |
| Both public and private services | Combine service-private paths with restricted general egress | Trace routes and logs to ensure each destination uses the intended path and no path bypasses controls. |
Hypothetical example: An internal application server needs operating-system updates, a public payment API and object storage. If the storage service supports a private endpoint, send that traffic through the dedicated path. Allow only necessary traffic to the public payment API and update server through NAT or a firewall/proxy. Let the database accept only the required application-server port, and do not allow Internet-initiated connections. This is an example, not a deployed or tested configuration. If a service has no private endpoint, it needs an explicit outbound path.
Check provider defaults
AWS private-subnet instances can use a NAT gateway for external services or VPC endpoints for supported services. Google Cloud generally restricts VMs without external IPs to internal destinations; Cloud NAT can provide egress to public destinations, while Private Google Access is a separate option for eligible Google APIs. Their targets and conditions differ.
Azure says that subnets in new virtual networks created with API versions released after March 31, 2026 do not receive default outbound access. Existing networks are not changed retroactively in the same way. If a new VM needs external access, such as Windows updates, plan an explicit method such as NAT Gateway or a firewall/NVA route. This default is date- and API-version-sensitive; check the current Microsoft documentation and resource properties when deploying.
How to troubleshoot a blocked connection
Identify whether the failure is inbound, general Internet egress or access to a specific service. Do not confuse a reply to a VM-initiated flow with an inbound connection.
Check addresses and name resolution: VM IPs, the destination DNS answer, and whether a private endpoint resolves to the intended address.
Trace the subnet route, default route, NAT/firewall/service endpoint attachment and actual next hop. A route does not prove that a rule allows the traffic.
Check security groups, network firewalls, NSGs, the operating-system firewall, service resource policies and authentication permissions for the required direction, port and destination.
Compare flow logs with the destination response. Separate DNS failure, missing route, firewall denial and service authorization failure; change one thing at a time and verify the intended path.
The goal is to let only necessary connections follow an intended path: restrict inbound exposure, then disable egress, control it through NAT/firewall, or narrow it to private service paths according to need.
References
[AWS: NAT gateways and private-subnet egress](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html)
[AWS: VPC endpoints for supported services](https://docs.aws.amazon.com/prescriptive-guidance/latest/secure-outbound-network-traffic/accessing-aws-resources.html)
[Google Cloud: Configure Private Google Access](https://docs.cloud.google.com/vpc/docs/configure-private-google-access)
[Google Cloud: Private access options for services](https://docs.cloud.google.com/vpc/docs/private-access-options)
[Google Cloud: Cloud NAT overview](https://docs.cloud.google.com/nat/docs/overview)
[Azure: Default outbound access and private-subnet defaults](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/default-outbound-access)
[Azure: NAT Gateway outbound connectivity](https://learn.microsoft.com/en-us/azure/nat-gateway/nat-overview)
[Azure: Private Endpoint overview](https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview/)