You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/firewall/integrate-lb.md
+45-19Lines changed: 45 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,18 @@
2
2
title: Integrate Azure Firewall with Azure Standard Load Balancer
3
3
description: You can integrate an Azure Firewall into a virtual network with an Azure Standard Load Balancer (either public or internal).
4
4
services: firewall
5
-
author: duongau
5
+
author: varunkalyana
6
6
ms.service: azure-firewall
7
7
ms.topic: how-to
8
-
ms.date: 06/14/2024
8
+
ms.date: 03/04/2025
9
9
ms.author: duau
10
10
---
11
11
12
12
# Integrate Azure Firewall with Azure Standard Load Balancer
13
13
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.
15
15
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.
17
17
18
18
For more information about Azure Load Balancer, see [What is Azure Load Balancer?](../load-balancer/load-balancer-overview.md)
19
19
@@ -27,42 +27,68 @@ Asymmetric routing is where a packet takes one path to the destination and takes
27
27
28
28
### Fix the routing issue
29
29
30
-
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).
30
+
#### Scenario 1: Azure Firewall without NAT Gateway
31
+
When deploying an Azure Firewall into a subnet, you need to create a default route for the subnet. This route directs packets through the firewall's private IP address located on the AzureFirewallSubnet. For detailed steps, see [Deploy and configure Azure Firewall using the Azure portal](tutorial-firewall-deploy-portal.md#create-a-default-route).
32
+
When integrating the firewall into your load balancer scenario, ensure that your Internet traffic enters through the firewall's public IP address. The firewall applies its rules and NAT the packets to the load balancer's public IP address. The issue arises when packets arrive at the firewall's public IP address but return via the private IP address (using the default route).
31
33
32
-
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).
33
-
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.
34
+
To prevent asymmetric routing, add a specific route for the firewall's public IP address. Packets intended for the firewall's public IP address are directed through the Internet, bypassing the default route to the firewall's private IP address.
34
35
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
36
+
:::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":::
37
37
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.
38
+
##### Route table example
39
+
40
+
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.
39
41
40
42
:::image type="content" source="media/integrate-lb/route-table.png" lightbox="media/integrate-lb/route-table.png" alt-text="Screenshot of route table.":::
43
+
44
+
#### Scenario 2: Azure Firewall with NAT Gateway
45
+
46
+
In some scenarios, you might configure a NAT Gateway on the Azure Firewall subnet to overcome SNAT (Source Network Address Translation) port limitations for outbound connectivity. In these cases, the route configuration in Scenario 1 doesn't work because the NAT Gateway's public IP address takes precedence over the Azure Firewall's public IP address.
47
+
48
+
For more information, see [Integration of NAT Gateway with Azure Firewall](../nat-gateway/tutorial-hub-spoke-nat-firewall.md).
49
+
50
+
:::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.":::
51
+
52
+
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.
53
+
54
+
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.
55
+
56
+
> [!IMPORTANT]
57
+
> Allow the NAT Gateway public IP address or public prefixes in the Network Security Group (NSG) rules associated with the resource (AKS/VM) subnet.
58
+
59
+
##### Route table example with NAT Gateway
60
+
61
+
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.
62
+
63
+
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.
64
+
65
+
:::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.":::
66
+
41
67
### NAT rule example
42
68
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:
69
+
In both scenarios, a NAT rule translates RDP (Remote Desktop Protocol) traffic from the firewall's public IP address (203.0.113.136) to the load balancer's public IP address (203.0.113.220):
44
70
45
71
:::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.":::
72
+
46
73
### Health probes
47
74
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.
75
+
Rememberto have a web service running on the hosts in the load balancer pool if you use TCP (Transport Control Protocol) health probes on port 80, or HTTP/HTTPS probes.
49
76
50
77
## Internal load balancer
51
78
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.
79
+
An internal load balancer is deployed with a private frontend IP address.
55
80
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.
81
+
This scenario doesn't 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.
57
82
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.
83
+
Deploy this scenario similarly to the public load balancer scenario, but without needing the firewall public IP address host route.
59
84
85
+
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.
60
86
61
87
## Extra security
62
88
63
-
To further enhance the security of your load-balanced scenario, you can use network security groups (NSGs).
89
+
To further enhance the security of your load-balanced scenario, use network security groups (NSGs).
64
90
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 firewallIP address/port.
91
+
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.
66
92
67
93
:::image type="content" source="media/integrate-lb/nsg-01.png" alt-text="Screenshot of network security group." lightbox="media/integrate-lb/nsg-01.png":::
0 commit comments