|
| 1 | +--- |
| 2 | +title: How to deploy hub and spoke topology with Azure Firewall |
| 3 | +description: Learn how to deploy a hub and spoke topology with Azure Firewall using Virtual Network Manager. |
| 4 | +author: mbender-ms |
| 5 | +ms.author: mbender |
| 6 | +ms.service: virtual-network-manager |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 06/04/2024 |
| 9 | +--- |
| 10 | + |
| 11 | +# How to deploy hub and spoke topology with Azure Firewall |
| 12 | + |
| 13 | +In this article, you learn how to deploy a hub and spoke topology with Azure Firewall using Azure Virtual Network Manager (AVNM). You create a network manager instance, and implement network groups for trusted and untrusted traffic. Next, you deploy a connectivity configuration for defining your hub and spoke topology. When deploying the connectivity configuration, you have a choice of adding [direct connectivity](concept-connectivity-configuration.md#direct-connectivity) for direct, trusted communication between spoke virtual networks, or requiring spokes to communicate through the hub network. You finish by deploying a routing configuration to route all traffic to Azure Firewall, except the traffic within the same virtual network when the virtual networks are trusted. |
| 14 | + |
| 15 | +Many organizations use Azure Firewall to protect their virtual networks from threats and unwanted traffic, and they route all traffic to Azure Firewall except trusted traffic within the same virtual network. Traditionally, setting up such a scenario is cumbersome because new user-defined routes (UDRs) need to be created for each new subnet, and all route tables have different UDRs. UDR management in Azure Virtual Network Manager can help you easily achieve this scenario by creating a routing rule that routes all traffic to Azure Firewall, except the traffic within the same virtual network. |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +- An Azure subscription with permissions to create resources in the subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/) before you begin. |
| 20 | +- Three virtual networks with subnets in the same region. One virtual network is the hub virtual network, and the other two virtual networks are the spoke virtual networks. |
| 21 | + - For this example, the hub virtual network is named **hub-vnet**, and the spoke virtual networks are **spoke-vnet-1** and **spoke-vnet-2**. |
| 22 | + - The hub virtual network requires a subnet for the Azure Firewall named **AzureFirewallSubnet**. |
| 23 | +- An Azure Virtual Network Manager instance with user-defined routing and connectivity configurations enabled. |
| 24 | +- All virtual networks configured in a hub and spoke topology. |
| 25 | +- An Azure Firewall in the hub virtual network. For more information, see [Deploy and configure Azure Firewall and policy using the Azure portal](../firewall/tutorial-firewall-deploy-portal-policy.md). |
| 26 | + |
| 27 | +[!INCLUDE [virtual-network-manager-create-udr-instance](../../includes/virtual-network-manager-create-udr-instance.md)] |
| 28 | + |
| 29 | +[!INCLUDE [virtual-network-manager-create-spoke-network-group](../../includes/virtual-network-manager-create-spoke-network-group.md)] |
| 30 | + |
| 31 | +[!INCLUDE [virtual-network-manager-deploy-hub-spoke-topology](../../includes/virtual-network-manager-deploy-hub-spoke-topology.md)] |
| 32 | + |
| 33 | +## Create a routing configuration and rule collection |
| 34 | + |
| 35 | +In this task, you create a routing configuration and rule collection that includes your spoke network group. Routing configurations define the routing rules for traffic between virtual networks. |
| 36 | + |
| 37 | +1. In the network manager instance, select **Configurations** under **Settings**. |
| 38 | +2. On the **Create a routing configuration** page, enter the routing configuration **Name** and **Description** on the **Basics** tab then select **Next: Rule collection >**. |
| 39 | +3. Select **Add** on the **Rule collections** tab. |
| 40 | +4. In the **Add a rule collection** window, enter or select the following settings for the rule collection: |
| 41 | + |
| 42 | + | **Setting** | **Value** | |
| 43 | + |---|---| |
| 44 | + | **Name** | Enter a name for your rule collection. | |
| 45 | + | **Description** | (Optional) Enter a description for your rule collection. | |
| 46 | + | **Local route setting** | Select **Direct routing within virtual network**. | |
| 47 | + | **Enable BGP route propagation** | (Optional) Select **Enable BGP route propagation** if you want to enable BGP route propagation. | |
| 48 | + | **Target network group** | Select your spoke network group. | |
| 49 | + |
| 50 | +1. Under **Routing rules**, select **Add** to create a new routing rule. |
| 51 | +2. In the **Add a routing rule** window, enter or select the following settings for the routing rule: |
| 52 | + |
| 53 | + | **Setting** | **Value** | |
| 54 | + |---|---| |
| 55 | + | **Name** | Enter a name for your routing rule. | |
| 56 | + | **Destination** | | |
| 57 | + | **Destination type** | Select **IP Address**. | |
| 58 | + | **Destination IP Addresses/CIDR ranges** | enter **0.0.0.0/0**. | |
| 59 | + | **Next hop** | | |
| 60 | + | **Next hop type** | Select **Virtual Appliance**.</br> Select **Import Azure firewall private IP address**| |
| 61 | + | **Azure firewalls** | Select your Azure firewall then choose **Select**. | |
| 62 | + |
| 63 | +3. Select **Add** to add the routing rule to the rule collection. |
| 64 | +4. Select **Add** to add the rule collection to the routing configuration. |
| 65 | + |
| 66 | + :::image type="content" source="media/how-to-deploy-hub-spoke-topology-with-azure-firewall/add-routing-rule.png" alt-text="Screenshot of Add a routing rule window with firewall as next hop."::: |
| 67 | + |
| 68 | +5. Select **Review + create** then select **Create**. |
| 69 | + |
| 70 | +## Deploy the routing configuration |
| 71 | + |
| 72 | +In this task, you deploy the routing configuration to create the routing rules for the hub and spoke topology. |
| 73 | + |
| 74 | +1. In the network manager instance, select **Deployments** under **Settings**. |
| 75 | +2. Select **Deploy configurations** then select **Routing configuration - Preview**. |
| 76 | +3. In the **Deploy a configuration** window, select the routing configuration you created, and select the **Target Regions** you wish to deploy the configuration to. |
| 77 | +1. Select **Next** or **Review + deploy** to review the deployment then select **Deploy**. |
| 78 | + |
| 79 | +## Delete all resources |
| 80 | + |
| 81 | +If you no longer need the resources created in this article, you can delete them to avoid incurring more costs. |
| 82 | + |
| 83 | +1. In the Azure portal, search for and select **Resource groups**. |
| 84 | +2. Select the resource group that contains the resources you want to delete. |
| 85 | + |
| 86 | +## Next steps |
| 87 | + |
| 88 | +> [!div class="nextstepaction"] |
| 89 | +> [Learn more about User defined routes (UDRs)](../virtual-network/virtual-networks-udr-overview.md) |
0 commit comments