Hello Peter Stieber
It looks like you're trying to understand the outbound traffic flow when a VM in a spoke VNet connects to the internet through an Azure Firewall and NAT Gateway setup.
Please check the below details:
1.Traffic Flow and NAT Behavior in VM in Spoke VNet initiates outbound traffic:
Traffic is routed to the Azure Firewall in the hub via VNet peering.
2.Azure Firewall processes the traffic, If the firewall allows the traffic, it will perform SNAT (Source Network Address Translation) unless:
The destination is within the same VNet or peered VNet.
You’ve configured Network Rules with “Translate” disabled (only possible with DNAT).
For Internet-bound traffic, Azure Firewall will perform SNAT by default, using its own public IP.
3.NAT Gateway on the firewall subnet:
Does not apply to traffic already SNAT’d by the Azure Firewall.
NAT Gateway only applies to resources in the subnet that are not performing their own SNAT.
Since Azure Firewall already SNATs the traffic, NAT Gateway does not re-SNAT it.
so Final Summary is the VM’s private IP is replaced by the Azure Firewall’s public IP and the NAT Gateway does not perform SNAT on traffic already processed by the firewall.
- The final source IP seen by the Internet destination is the Azure Firewall’s public IP, not the NAT Gateway’s.
I hope this helps! If these answers your query, do click the "Upvote" of which might be beneficial to other community members reading this thread.
If the above is unclear or you are unsure about something, please add a comment below.