Thanks for reaching out Microsoft Q&A.
To set up forced tunneling for internet-bound traffic from your Azure environment to your on-premises firewall using a shared ExpressRoute circuit, both options you mentioned are valid but need careful implementation due to the shared nature of the circuit and routing requirements.
Option 1: Advertise 0.0.0.0/0 from On-Prem Edge
- Advertising 0.0.0.0/0 via BGP will send all internet-bound traffic from Azure to on-premises through ExpressRoute for any environment attached to the circuit.
- With a shared circuit, you can't granularly scope BGP advertisements to just one environment (such as env-2) if both environments use the same peering and circuit. The default route will apply to all VNETs attached to the peering unless you separate routing at the network layer using route filters or multiple peerings.
- The connections themselves are “stateful” as long as the bidirectional route exists—return traffic will follow the same path unless overridden by UDRs or asymmetric routing introduced by responses using Internet breakout in Azure. Asymmetric routing could occur if BGP learns 0.0.0.0/0 for multiple environments and the firewall is not configured to handle multi-environment traffic appropriately. Ensuring return traffic passes back through the same path may require careful UDR design and firewall rules.
Option 2: Add UDR to AzureFirewallSubnet Pointing to On-Prem FW
- You can configure User Defined Routes (UDRs) pointing the 0.0.0.0/0 next hop to your on-prem firewall for the AzureFirewallSubnet or other subnets as needed. This allows for more granular control, especially if BGP propagation is disabled and spokes use static UDRs.
- Microsoft recommends deploying a dedicated AzureFirewallManagementSubnet for management traffic with a default route to the internet, while customer traffic in the AzureFirewallSubnet can use UDRs pointing to on-premises firewalls or network virtual appliances.
- In terms of stateful connections, forced tunneling via UDRs ensures all traffic, including responses, flows through the specified next hop, maintaining connection state. Care must be taken to avoid routing loops or unintended drops in return traffic, especially when combining UDR and BGP advertisements.
Use Option 2: Configure User Defined Routes (UDRs) on the AzureFirewallSubnet in env-2 to send internet traffic to the on-prem firewall. This lets you control forced tunneling per environment on the shared circuit and keeps traffic stateful. Avoid advertising 0.0.0.0/0 via BGP on the shared circuit, as it affects both environments.
If I add a UDR on the AzureFirewallSubnet that points 0.0.0.0/0 to the on-prem firewall, do I need any additional routes?
Yes, you still need one more route change. You must add routes on the GatewaySubnet so that on-prem → spoke traffic is forced through the Azure Firewall. Without that, return traffic can become asymmetric. Once the GatewaySubnet routes and the UDR on the AzureFirewallSubnet are in place, the traffic will remain stateful and work correctly.
Reference:
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.