Skip to content

Commit 3df47d0

Browse files
committed
update with nat gateway
1 parent a2daa1f commit 3df47d0

File tree

3 files changed

+43
-16
lines changed

3 files changed

+43
-16
lines changed

articles/firewall/integrate-lb.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
title: Integrate Azure Firewall with Azure Standard Load Balancer
33
description: You can integrate an Azure Firewall into a virtual network with an Azure Standard Load Balancer (either public or internal).
44
services: firewall
5-
author: duongau
5+
author: varunkalyana
66
ms.service: azure-firewall
77
ms.topic: how-to
8-
ms.date: 06/14/2024
8+
ms.date: 03/04/2025
99
ms.author: duau
1010
---
1111

1212
# Integrate Azure Firewall with Azure Standard Load Balancer
1313

14-
You can integrate an Azure Firewall into a virtual network with an Azure Standard Load Balancer (either public or internal).
14+
You can integrate an Azure Firewall into a virtual network with either a public or internal Azure Standard Load Balancer.
1515

16-
The preferred design is to integrate an internal load balancer with your Azure firewall, as this is a simpler design. You can use a public load balancer if you already have one deployed and you want to keep it in place. However, you need to be aware of an asymmetric routing issue that can break functionality with the public load balancer scenario.
16+
The preferred design is to use an internal load balancer with your Azure Firewall, as it simplifies the setup. If you already have a public load balancer deployed and wish to continue using it, be aware of potential asymmetric routing issues that could disrupt functionality.
1717

1818
For more information about Azure Load Balancer, see [What is Azure Load Balancer?](../load-balancer/load-balancer-overview.md)
1919

@@ -27,42 +27,69 @@ Asymmetric routing is where a packet takes one path to the destination and takes
2727

2828
### Fix the routing issue
2929

30+
#### Scenario 1: Azure Firewall without NAT Gateway
31+
3032
When you deploy an Azure Firewall into a subnet, one step is to create a default route for the subnet directing packets through the firewall's private IP address located on the AzureFirewallSubnet. For more information, see [Tutorial: Deploy and configure Azure Firewall using the Azure portal](tutorial-firewall-deploy-portal.md#create-a-default-route).
3133

3234
When you introduce the firewall into your load balancer scenario, you want your Internet traffic to come in through your firewall's public IP address. From there, the firewall applies its firewall rules and NATs the packets to your load balancer's public IP address. This is where the problem occurs. Packets arrive on the firewall's public IP address, but return to the firewall via the private IP address (using the default route).
3335
To avoid this problem, create another host route for the firewall's public IP address. Packets going to the firewall's public IP address are routed via the Internet. This avoids taking the default route to the firewall's private IP address.
3436

35-
:::image type="content" source="media/integrate-lb/Firewall-LB-asymmetric.png" alt-text="Diagram of asymmetric routing." lightbox="media/integrate-lb/Firewall-LB-asymmetric.png":::
36-
### Route table example
37+
:::image type="content" source="media/integrate-lb/Firewall-LB-asymmetric.png" alt-text="Diagram of asymmetric routing and the workaround solution." lightbox="media/integrate-lb/Firewall-LB-asymmetric.png":::
38+
39+
##### Route table example
3740

38-
For example, the following routes are for a firewall at public IP address 203.0.113.136, and private IP address 10.0.1.4.
41+
For example, the following route table shows routes for a firewall with a public IP address of 203.0.113.136 and a private IP address of 10.0.1.4.
3942

4043
:::image type="content" source="media/integrate-lb/route-table.png" lightbox="media/integrate-lb/route-table.png" alt-text="Screenshot of route table.":::
44+
45+
#### Scenario 2: Azure Firewall with NAT Gateway
46+
47+
In some scenarios, you may configure a NAT Gateway on the Azure Firewall subnet to overcome SNAT port limitations for outbound connectivity. In these cases, the route configuration in Scenario 1 won't work because the NAT Gateway's public IP address will take precedence over the Azure Firewall's public IP address.
48+
49+
For more information, see [Integration of NAT Gateway with Azure Firewall](../nat-gateway/tutorial-hub-spoke-nat-firewall.md).
50+
51+
:::image type="content" source="media/integrate-lb/nat-firewall-routing.png" alt-text="Diagram of routing with NAT Gateway associated to the Azure Firewall subnet.":::
52+
53+
When a NAT Gateway is associated with the Azure Firewall subnet, inbound traffic from the internet lands on the Azure Firewall's public IP address. The Azure Firewall then changes (SNAT) the source IP to the NAT Gateway's public IP address before forwarding the traffic to the load balancer's public IP address.
54+
55+
Without a NAT Gateway, the Azure Firewall changes the source IP address to its own public IP address before forwarding the traffic to the load balancer's public IP address.
56+
57+
> [!IMPORTANT]
58+
> Allow the NAT Gateway public IP address or public prefixes in the Network Security Group (NSG) rules associated with the resource (AKS/VM) subnet.
59+
60+
##### Route table example with NAT Gateway
61+
62+
You must add a route for the return path to use the NAT Gateway public IP address instead of the Azure Firewall public IP address with Internet as the next hop.
63+
64+
For example, the following route table shows routes for a NAT Gateway with a public IP address of 198.51.100.101 and a firewall with a private IP address of 10.0.1.4.
65+
66+
:::image type="content" source="media/integrate-lb/firewall-route-table.png" alt-text="Screenshot of the route table showing a route with the destination as the NAT Gateway Public IP address and the next hop as Internet.":::
67+
4168
### NAT rule example
4269

43-
In the following example, a NAT rule translates RDP traffic to the firewall at 203.0.113.136 over to the load balancer at 203.0.113.220:
70+
In both scenarios, a NAT rule translates RDP traffic from the firewall's public IP address (203.0.113.136) to the load balancer's public IP address (203.0.113.220):
4471

4572
:::image type="content" source="media/integrate-lb/nat-rule-02.png" lightbox="media/integrate-lb/nat-rule-02.png" alt-text="Screenshot of NAT rule.":::
73+
4674
### Health probes
4775

48-
Remember, you need to have a web service running on the hosts in the load balancer pool if you use TCP health probes to port 80, or HTTP/HTTPS probes.
76+
Remember to have a web service running on the hosts in the load balancer pool if you use TCP health probes on port 80, or HTTP/HTTPS probes.
4977

5078
## Internal load balancer
5179

52-
With an internal load balancer, the load balancer is deployed with a private frontend IP address.
53-
54-
There's no asymmetric routing issue with this scenario. The incoming packets arrive at the firewall's public IP address, get translated to the load balancer's private IP address, and then returns to the firewall's private IP address using the same return path.
80+
An internal load balancer is deployed with a private frontend IP address.
5581

56-
So, you can deploy this scenario similar to the public load balancer scenario, but without the need for the firewall public IP address host route.
82+
This scenario does not have asymmetric routing issues. Incoming packets arrive at the firewall's public IP address, are translated to the load balancer's private IP address, and return to the firewall's private IP address using the same path.
5783

58-
The virtual machines in the backend pool can have outbound Internet connectivity through the Azure Firewall. Configure a user defined route on the virtual machine's subnet with the firewall as the next hop.
84+
Deploy this scenario similarly to the public load balancer scenario, but without needing the firewall public IP address host route.
5985

86+
Virtual machines in the backend pool can have outbound Internet connectivity through the Azure Firewall. Configure a user-defined route on the virtual machine's subnet with the firewall as the next hop.
6087

6188
## Extra security
6289

63-
To further enhance the security of your load-balanced scenario, you can use network security groups (NSGs).
90+
To further enhance the security of your load-balanced scenario, use network security groups (NSGs).
6491

65-
For example, you can create an NSG on the backend subnet where the load-balanced virtual machines are located. Allow incoming traffic originating from the firewall IP address/port.
92+
For example, create an NSG on the backend subnet where the load-balanced virtual machines are located. Allow incoming traffic originating from the firewall's public IP address and port. If a NAT Gateway is associated with the Azure Firewall subnet, allow incoming traffic originating from the NAT Gateway's public IP address and port.
6693

6794
:::image type="content" source="media/integrate-lb/nsg-01.png" alt-text="Screenshot of network security group." lightbox="media/integrate-lb/nsg-01.png":::
6895

32 KB
Loading
50.1 KB
Loading

0 commit comments

Comments
 (0)