How to determine that network prefix was learned from ExpressRoute

Peter Stieber 180 Reputation points
2025-06-04T16:29:21.78+00:00

Is there a way to easily determine from API that the prefix is being learned from Express Route ? All I see are routes where next hop points to MSEE IP and nexthop type is set to VirtualNetworkGateway. However, VirtualNetworkGateway nexthop type can also mean VPN gateway or RouteServer that acts as route reflector. Why does azure not use source or nextHopType property to provide information about the real source ? This would be a huge help for people who use API.

 {
        "addressPrefix": [
          "192.168.0.0/24"
        ],
        "destinationServiceTags": [],
        "disableBgpRoutePropagation": false,
        "hasBgpOverride": false,
        "nextHopIpAddress": [
          "10.63.1.225"
        ],
        "nextHopType": "VirtualNetworkGateway", -----> VPN Gateway? NVA? ER Gateway ?
        "source": "VirtualNetworkGateway",
        "state": "Active",
        "tagMap": {}
      }
Azure ExpressRoute
Azure ExpressRoute
An Azure service that provides private connections between Azure datacenters and infrastructure, either on premises or in a colocation environment.
{count} votes

Accepted answer
  1. Deepanshu katara 17,255 Reputation points MVP Moderator
    2025-06-04T16:42:34.1633333+00:00

    Hello , Welcome to MS Q&A

    I think Currently, Azure’s route API does not expose a property that directly tells you if a prefix is learned from ExpressRoute, VPN, or Route Server. This is a known limitation and feedback has been provided by many users for more granular route source information.

    Hence ,

    • There is no explicit API property for "ExpressRoute" as the source.
    • Use the combination of nextHopType and known MSEE IPs to infer ExpressRoute-learned prefixes.

    Moreover you can utilize BGP Community values to identify prefixes from each Azure region. This method helps in optimizing routing and ensuring that traffic takes the optimal path. For example, specific BGP Community values are assigned to different Azure regions, which can be used to identify the source of the prefix.

    For more detailed information, you can refer to the Azure documentation on optimizing routing for ExpressRoute. This documentation provides insights into using BGP Community values and other techniques to manage routing effectively.

    Pls check and let us know if it helps

    Thanks

    Deepanshu


0 additional answers

Sort by: Most helpful

Your answer

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