Routes, Internet Access and NAT
On AWS, internet access is explicit plumbing: an internet gateway, a route 0.0.0.0/0 → igw in the public subnets' route table, and a NAT gateway for the private ones. Azure and Google Cloud have system routes to the internet built in, so what decides reachability is mostly public IPs and NAT, and on Azure a default-outbound behaviour that is being retired.
On AWS this is… internet gateways, route tables and NAT gateways from Route Tables and NAT.
Side by side
| AWS | Azure | Google Cloud | |
|---|---|---|---|
| Internet gateway | create and attach an IGW | none: built into the platform | none: a default route to the "default internet gateway" exists in every network |
| Default routes | local route only, you add 0.0.0.0/0 |
system routes: VNet-local, peerings, 0.0.0.0/0 → Internet |
auto-created: subnet routes and 0.0.0.0/0 → default-internet-gateway |
| Custom routes | route tables per subnet | route tables (user-defined routes, UDRs) associated with subnets | routes on the network, optionally limited by network tags; policy-based routes |
| Inbound from internet | public IP + IGW route + SG | public IP (or load balancer) + NSG | external IP (or load balancer) + firewall rule |
| Outbound for private VMs | NAT gateway in a public subnet | NAT Gateway associated with the subnet | Cloud NAT on a Cloud Router per region |
| Reach provider APIs privately | VPC gateway/interface endpoints | service endpoints, private endpoints | Private Google Access, Private Service Connect |
Azure: default outbound access is going away
For years, an Azure VM with no public IP and no NAT still reached the internet through a hidden, Microsoft-owned default outbound IP. It is convenient and bad: the IP can change, can't be allow-listed, and contradicts "private means private". Azure is retiring it: for networking API versions released after 31 March 2026, subnets in new VNets are private by default (defaultOutboundAccess: false), and the portal already creates private subnets. Existing VNets keep their behaviour until you change them.
So on Azure, plan explicit egress for every subnet that needs the internet:
- a NAT Gateway on the subnet (the usual choice), or
- a firewall / network virtual appliance with a UDR
0.0.0.0/0 → VirtualAppliance, or - a Standard load balancer with outbound rules, or a public IP on the VM.
Watch out for Terraform: the azurerm_subnet resource's default_outbound_access_enabled argument defaults to true. Set it to false explicitly.
Model: which way does a packet leave?
A tiny route-selection model: longest prefix match first, then the next hop decides. It runs the same lookup for an Azure subnet with a UDR to a firewall and for a Google Cloud subnet using Cloud NAT:
import ipaddress
def lookup(routes, dest):
ip = ipaddress.ip_address(dest)
matches = [(ipaddress.ip_network(p), hop) for p, hop in routes if ip in ipaddress.ip_network(p)]
net, hop = max(matches, key=lambda m: m[0].prefixlen)
return f"{dest:<15} matches {str(net):<14} -> {hop}"
azure_system = [ # routes Azure creates for every subnet
("10.30.0.0/16", "VnetLocal"),
("10.50.0.0/16", "VNetPeering (hub)"),
("0.0.0.0/0", "Internet (system)"),
]
azure_udr = [("0.0.0.0/0", "VirtualAppliance 10.50.1.4 (UDR)")] # route table on snet-app
# a user-defined route replaces the system route with the same prefix
udr_prefixes = {p for p, _ in azure_udr}
azure_effective = [r for r in azure_system if r[0] not in udr_prefixes] + azure_udr
gcp_app_ew1 = [
("10.40.16.0/20", "subnet route app-ew1"),
("10.40.64.0/20", "subnet route app-uc1 (us-central1, same network)"),
("0.0.0.0/0", "default-internet-gateway (VM has no external IP: Cloud NAT translates)"),
]
print("Azure snet-app")
for d in ["10.30.17.4", "10.50.2.9", "93.184.215.14"]:
print(" ", lookup(azure_effective, d))
print("GCP app-ew1")
for d in ["10.40.70.3", "93.184.215.14"]:
print(" ", lookup(gcp_app_ew1, d))Azure snet-app
10.30.17.4 matches 10.30.0.0/16 -> VnetLocal
10.50.2.9 matches 10.50.0.0/16 -> VNetPeering (hub)
93.184.215.14 matches 0.0.0.0/0 -> VirtualAppliance 10.50.1.4 (UDR)
GCP app-ew1
10.40.70.3 matches 10.40.64.0/20 -> subnet route app-uc1 (us-central1, same network)
93.184.215.14 matches 0.0.0.0/0 -> default-internet-gateway (VM has no external IP: Cloud NAT translates)
The Google Cloud row for 10.40.70.3 is a VM in us-central1: every subnet of the global network gets a subnet route in every region, so it is reachable with no peering. On Azure, a user-defined route with the same prefix as a system route replaces it, which is how hub-and-spoke designs force all egress through a central firewall.
Setting up NAT
Azure, sample session:
az network public-ip create -g rg-shop-prod-network -n pip-nat-shop --sku Standard --zone 1 2 3
az network nat gateway create -g rg-shop-prod-network -n ng-shop-prod \
--public-ip-addresses pip-nat-shop --idle-timeout 4
az network vnet subnet update -g rg-shop-prod-network --vnet-name vnet-shop-prod -n snet-app \
--nat-gateway ng-shop-prodGoogle Cloud, sample session (Cloud NAT is regional; it is configured on a Cloud Router):
gcloud compute routers create shop-router-ew1 --network=shop-vpc --region=europe-west1
gcloud compute routers nats create shop-nat-ew1 --router=shop-router-ew1 --region=europe-west1 \
--auto-allocate-nat-external-ips --nat-all-subnet-ip-rangesCloud NAT is not a box in your network that traffic flows through: it is configured into Google's software-defined networking, so there is no single NAT instance to fail, and no "NAT per zone" design to copy from AWS. One Cloud NAT per region per network is the normal layout. Azure's NAT Gateway is a regional resource too (zonal or zone-redundant depending on SKU and configuration).
Same idea, three shapes
| AWS habit | Azure translation | Google Cloud translation |
|---|---|---|
| "public subnet" with IGW route | subnet whose VMs or load balancers have public IPs | subnet whose VMs have external IPs (block with compute.vmExternalIpAccess) |
| one NAT gateway per AZ for resilience | one NAT Gateway per subnet group, zone-redundant where available | one Cloud NAT per region |
| S3 gateway endpoint | service endpoint Microsoft.Storage or a private endpoint |
Private Google Access on the subnet |
route 0.0.0.0/0 → firewall |
UDR with next hop VirtualAppliance |
custom static route with a next-hop instance or internal load balancer |
Test yourself
What changed for new Azure VNets created with networking API versions after 31 March 2026?
- Subnets can no longer have NSGs
- Subnets are private by default: no default outbound access
- VNets became global
- NAT Gateway was retired
On Google Cloud, where is Cloud NAT configured?
- On each VM
- On a Cloud Router in a region
- In a public subnet as an instance
- On the global network only
How do you force all internet-bound traffic from an Azure subnet through a firewall?
- Delete the system routes
- Associate a route table with a UDR 0.0.0.0/0 → VirtualAppliance (the firewall's IP)
- Add a public IP to the firewall only
- Use a resource lock