Introduction
In any cloud deployment, network routing is a core component of security and traffic management. By default, Azure automatically handles routing within a virtual network. However, in scenarios where outbound traffic must be filtered and inspected by a firewall, custom routes are required.
This guide walks you through the process of configuring network routing in Azure by creating a route table, associating it with subnets, and directing outbound traffic through an Azure Firewall for inspection and policy enforcement.
Skilling Objectives
By completing this walkthrough, you will learn how to:
- Create and configure a custom route table.
- Associate the route table with frontend and backend subnets.
- Add a route that forces outbound traffic through a firewall’s private IP.
Architecture Overview
The architecture consists of a single application virtual network (app-vnet) with multiple subnets:
- A frontend subnet hosting the application’s frontend workloads.
- A backend subnet hosting the application’s backend workloads.
- An Azure Firewall deployed inside the virtual network to filter and inspect traffic.
- A route table that overrides Azure’s default system routes and sends all outbound traffic through the firewall.
This design ensures that every outbound request from your workloads is inspected by the firewall before leaving the virtual network.
Step 1: Record the Firewall’s Private IP Address
Before you configure the route table, you need the firewall’s private IP address.
In the Azure portal, search for Firewall and select your firewall instance (for example, app-vnet-firewall).
This private IP will be used as the next hop in your custom route.
Step 2: Create a Route Table
Now create a custom route table to override Azure’s system routes.
In the Azure portal, search for Route tables and select + Create.
Use your existing subscription and resource group (for example, RG1).
Choose the region (such as East US).
Name the route table (for example, app-vnet-firewall-rt).
Step 3: Associate the Route Table with Subnets
Next, you need to link the route table to the subnets where traffic should be filtered.
- Open the route table you just created.
- In the Settings blade, select Subnets and then choose + Associate.
Associate the route table with the frontend subnet of app-vnet.
Repeat the same process and associate it with the backend subnet.
Now both frontend and backend workloads will send traffic using this route table.
Step 4: Create a Route in the Route Table
Finally, you’ll create a custom route that directs all outbound traffic to the firewall.
- Open the same route table and select Routes under the Settings blade.
- Choose + Add to create a new route.
- Enter a route name such as
outbound-firewall
. - For destination type, select IP addresses.
- Enter
0.0.0.0/0
as the destination address range to capture all outbound traffic. - For the next hop type, select Virtual appliance.
- Enter the private IP address of the firewall you recorded earlier.
- Select Add to save the route.
Conclusion
In this walkthrough, you configured network routing in Azure to ensure all outbound traffic passes through a firewall for inspection. You created a route table, associated it with your application’s frontend and backend subnets, and defined a custom route that directs all traffic to the firewall.
With this setup, your workloads are protected by centralized routing rules, ensuring that security policies are consistently enforced across the environment.
Top comments (0)