Skip to main content

Task 07: NAT Gateway

Runbook Azure

DOCUMENT CATEGORY: Runbook
SCOPE: NAT Gateway deployment
PURPOSE: Provide deterministic outbound internet access for management VMs
MASTER REFERENCE: Microsoft Learn - NAT Gateway

Status: Active

Overview​

This task deploys an Azure NAT Gateway and associates it with the management subnet. The NAT Gateway provides deterministic outbound internet connectivity with a static public IP, eliminating SNAT port exhaustion and ensuring consistent outbound IP for allowlisting.

Task Classification

Execution Target: Azure-Only (control-plane API operation) Tab Profile: 3 tabs — Azure Portal · PowerShell · Azure CLI

Terraform Reference

Module: azurelocal-toolkit File: nat-gateway.tf Mode: Management

Components Created​

ResourceName PatternPurpose
Public IPpip-azrlnat-{env}-{region}-01NAT Gateway public IP
NAT Gatewayng-azrl-{env}-{region}-01Outbound internet access
PIP Association—Link PIP to NAT GW
Subnet Association—Link NAT GW to management subnet

NAT Gateway Configuration​

SettingValueSource
SKUStandard (default) or StandardV2 (zone redundant; StandardV2 public IPs only)landing_zone.connectivity.nat_gateway.sku (Terraform route)
Idle TimeoutPer config (minutes)landing_zone.connectivity.nat_gateway.idle_timeout_minutes
SubnetManagement subnetlanding_zone.networks[].subnets[].name

Prerequisites​

Values from infrastructure.yml​

The script reads these keys from infrastructure.yml (schema 5). Each key, with its type, default and example, is in the variables reference.

azure.tenant_id, azure.location, tags
landing_zone.connectivity.nat_gateway.name, .resource_group, .network, .subnets, .idle_timeout_minutes
landing_zone.networks[].name, .subscription, .resource_group, .location where the network is
landing_zone.subscriptions[].name, .id the subscription that holds the network

The Terraform route (src/terraform/modules/networking) also reads two keys added in registry 5.0.62 (schema 5.6.28, optional): landing_zone.connectivity.nat_gateway.public_ip_name (the name of the public IP of the NAT gateway) and landing_zone.connectivity.nat_gateway.sku (Standard, the default, or StandardV2).


Single Subscription Model​

Landing Zone Placement​

FieldValueConfig Path
SubscriptionCustomer subscriptionlanding_zone.subscriptions[].id
Resource Grouprg-azrlmgmt-{env}-{region}-01landing_zone.networks[].resource_group
NAT Gateway Nameng-azrl-{env}-{region}-01Naming convention
Public IP Namepip-azrlnat-{env}-{region}-01Naming convention (Terraform route: landing_zone.connectivity.nat_gateway.public_ip_name)

Execution Options​

Azure Portal​

When to use: Learning Azure Local, single deployment, prefer visual interface

Procedure​

  1. Create Public IP:
  • Search for Public IP addresses → + Create | Field | Value | |-------|-------| | Name | pip-azrlnat-{env}-{region}-01 | | SKU | Standard | | Assignment | Static |
  1. Create NAT Gateway:
  • Search for NAT gateways → + Create | Field | Value | Source | |-------|-------|--------| | Name | ng-azrl-{env}-{region}-01 | Naming convention | | Region | Your region | azure.location | | Availability zone | No zone | Or zone-redundant | | Idle timeout | Per config (minutes) | landing_zone.connectivity.nat_gateway.idle_timeout_minutes |
  1. Outbound IP: Select the Public IP created in Step 1

  2. Subnet: Select the management subnet from the VNet

  3. Review + create: Verify → Click Create

Validation​

  • NAT Gateway provisioning state: Succeeded
  • Public IP associated
  • Management subnet associated
  • Outbound connectivity works from management VMs

Validation​

  • NAT Gateway provisioned
  • Public IP associated
  • Management subnet associated
  • Outbound traffic from VMs uses NAT Gateway PIP

CAF/WAF Landing Zone Model​

In the CAF/WAF model, the NAT Gateway is deployed in the Connectivity subscription alongside the VNet.

Landing Zone Placement​

FieldValueConfig Path
SubscriptionConnectivity subscriptionlanding_zone.subscriptions[].id
Resource Grouprg-azrlconn-{env}-{region}-01landing_zone.networks[].resource_group

Execution Options​

Azure Portal​

Follow the same procedure as Single Subscription → Azure Portal, targeting the Connectivity subscription.

Validation​

  • NAT Gateway in Connectivity subscription
  • Outbound connectivity verified

Troubleshooting​

IssueRoot CauseRemediation
SNAT port exhaustionToo many concurrent connectionsAdd additional public IPs to NAT GW
NAT GW not taking effectSubnet not associatedVerify subnet association
Conflicts with load balancerLB outbound rules take precedenceRemove LB outbound rules or use NAT GW only
Idle timeout too shortConnections drop prematurelyIncrease idle timeout (max 120 min)


Alternatives​

The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.

PreviousUpNext
Task 06: NSGsManual Deployment IndexTask 08: Arc Gateway

Version Control

  • Created: 2025-09-15 by Hybrid Cloud Solutions
  • Last Updated: 2026-03-03 by Hybrid Cloud Solutions
  • Version: 4.0.0
  • Tags: azure-local, nat-gateway, networking, outbound
  • Keywords: NAT gateway, outbound internet, SNAT, public IP, management subnet
  • Author: Hybrid Cloud Solutions

Version Control​

VersionDateAuthorChanges
1.0.02025-03-25Azure Local CloudInitial release