Share via

Want to route on-prem traffic to internet through azure firewall

GAWAI, SRIKANT 0 Reputation points
2025-12-22T05:59:43.41+00:00

We want to route on-premises traffic to the internet through Azure Firewall.

For that, we have deployed an ExpressRoute connection between on-premises and Azure.

Now we are trying to route the traffic from the GatewaySubnet to the firewall by defining a route with 0.0.0.0/0 as the destination and the firewall as the next hop, but it shows the error: "Cannot associate the default route 0.0.0.0/0 to GatewaySubnet."

How can I establish a route from GatewaySubnet to Azure Firewall for both inbound and outbound connections?

Azure Firewall
Azure Firewall

An Azure network security service that is used to protect Azure Virtual Network resources.

0 comments No comments

2 answers

Sort by: Most helpful
  1. GAWAI, SRIKANT 0 Reputation points
    2026-02-03T08:59:24.0033333+00:00

    Thank you, Thanmayi, for your comments.

    I have already applied default route to the spoke subnet. The traffic from the on-premises reaching upto express route circuit only. How should I route that traffic from circuit to firewall now so that it can go out to the internet.

    0 comments No comments

  2. Thanmayi Godithi 8,310 Reputation points Microsoft External Staff Moderator
    2025-12-22T06:26:56.1633333+00:00

    Hi @GAWAI, SRIKANT,

    Thank you for reaching out on Microsoft Q&A forum.

    I understand your issue regarding routing on-premises traffic to the Internet through Azure Firewall over ExpressRoute.

    You attempt to create a user-defined route (UDR) on the GatewaySubnet with a destination of 0.0.0.0/0 pointing to Azure Firewall failed with "Cannot associate the default route 0.0.0.0/0 to GatewaySubnet." error and this behavior is expected due to Azure’s restrictions on GatewaySubnet configuration.

    From the official documentation (Azure VPN Gateway Settings):User's image

    So, applying a default route (0.0.0.0/0) to the GatewaySubnet would prevent the gateway from communicating with its management infrastructure.Any route overlapping the GatewaySubnet or gateway IP ranges is blocked.This restriction ensures proper operation of the gateway, BGP, and diagnostic functions.

    To route on-premises traffic to the Internet via Azure Firewall:

    1.Keep GatewaySubnet untouched

    • Do not assign UDRs with 0.0.0.0/0 or NSGs that block traffic.

    2.Use Hub-Spoke topology with UDRs

    • Place Azure Firewall in a dedicated subnet (e.g., AzureFirewallSubnet) in the Hub VNet.
    • Apply UDRs to other subnets (spoke VNets or on-prem routes via BGP) with next-hop set to Azure Firewall private IP.

    3.Enable BGP route propagation on the GatewaySubnet

    • This allows the gateway to advertise the forced-tunneling routes to on-premises without breaking gateway functionality.

    4.Azure Firewall handles outbound NAT

    • All traffic routed through the firewall will be NAT’d to the Internet, and return traffic flows correctly back to on-premises.

    Refer- Forced tunneling with Azure Firewall

    Kindly let us know if the above helps or you need further assistance on this issue.

    If the answer is helpful, please 'Accept the answer' and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.