Subnet / Express route question

JoelP 241 Reputation points
2024-01-10T21:05:08.2866667+00:00

Does a custom subnet route override the route table setup via the gateway subnet. Just wanted to ask before trying it out as we need to bypass express route from a vm on a particular subnet to go via azure internet for certain ip address range. We are using hub and spoke architecture. Thanks

Azure ExpressRoute
Azure ExpressRoute
An Azure service that provides private connections between Azure datacenters and infrastructure, either on premises or in a colocation environment.
340 questions
0 comments No comments
{count} votes

Accepted answer
  1. ChaitanyaNaykodi-MSFT 24,231 Reputation points Microsoft Employee
    2024-01-10T22:34:35.4466667+00:00

    @JoelP Thank you for reaching out. I understand you wish to know if a custom subnet route can override the route table setup via the gateway subnet. The answer is yes, as documented here.

    • When outbound traffic is sent from a subnet, Azure selects a route based on the destination IP address, using the longest prefix match algorithm. For example, a route table has two routes: One route specifies the 10.0.0.0/24 address prefix, while the other route specifies the 10.0.0.0/16 address prefix. Azure directs traffic destined for 10.0.0.5 to the next hop type specified in the route with the 10.0.0.0/24 address prefix. This process occurs because 10.0.0.0/24 is a longer prefix than 10.0.0.0/16, even though 10.0.0.5 falls within both address prefixes. As your subnet route will be more specific. That one will be selected.
    • If multiple routes contain the same address prefix, Azure selects the route type, based on the following priority (As for Express route BGP is used for custom routes)
      1. User-defined route
      2. BGP route
      Hope this helps! Please let me know if you have any additional questions. Thank you! ​​Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

0 additional answers

Sort by: Most helpful