Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI Studio
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Router
    • All use cases
    • On-prem without redundancy and 1 VPC
    • On-prem without redundancy and multiple VPCs
    • On-prem with redundancy and 1 VPC
    • On-prem with redundancy and multiple VPCs
    • Two separate RIs without on-prem redundancy
    • Even redistribution of on-prem traffic (Active-Active)
    • Prioritizing on-prem traffic based on direction (Active-Standby)
    • On-prem (PRC) connection redundancy via a VPN gateway
    • Prioritizing a static VPC route over routes from PRC
    • Even traffic distribution for route 0.0.0.0/0
    • Prioritizing traffic by direction for route 0.0.0.0/0
    • VPC Stithcing. Connectivity for two cloud networks
    • VPC Stitching. Connectivity for two cloud networks and on-prem
  • Access management
  • Release notes

In this article:

  • Longest prefix match (LPM)
  • BGP AS path prepend
  1. Use cases
  2. Prioritizing traffic by direction for route 0.0.0.0/0

Prioritizing traffic by direction for route 0.0.0.0/0

Written by
Yandex Cloud
Updated at June 10, 2025
  • Longest prefix match (LPM)
  • BGP AS path prepend

To prioritize traffic by direction in Cloud Interconnect, you can use the following methods:

  • Longest Prefix Match (LPM)
  • BGP AS path prepend (available as of 03/07/2023)

The longest prefix match method has a higher priority than BGP AS path prepending when it comes to the algorithm for selecting the best route on routers.{#lpm1} We recommend that you only choose one of the suggested methods rather than use both at the same time.

Longest prefix match (LPM)Longest prefix match (LPM)

Below, you can see an example of prioritizing traffic through two private connections set up via two points of presence.

The customer edge router (R2) uses the NORD PoP to announce the default route from the customer infrastructure, 0.0.0.0/0, over BGP towards Yandex Cloud.

Another customer edge router (R1) uses the M9 PoP to announce two long (more specific) prefixes from the customer infrastructure, 0.0.0.0/1 and 128.0.0.0/1, over BGP towards Yandex Cloud.

Yandex Cloud will treat announcements via M9 as more specific ones, i.e., of higher priority.

This way, all traffic from the cloud subnets will be routed through the private connection to M9. If this connection fails, the traffic will automatically failover to the private connection to NORD.

BGP AS path prependBGP AS path prepend

Below, you can see an example of prioritizing traffic through two private connections set up via two points of presence with the BGP AS path prepend method.

You can learn more about BGP AS path prepending here.

The customer edge router (R1) uses the M9 PoP to announce the default route from the customer infrastructure, 0.0.0.0/0, over BGP towards Yandex Cloud. The BGP AS_PATH attribute will default to 65001, and the AS path length (count of autonomous system number values) will be 1.

Another customer edge router (R2) announces the same prefix (0.0.0.0/0) from the customer infrastructure over BGP through the NORD PoP towards Yandex Cloud.

Before announcing the prefix, the BGP routing policy on the R2 router adds the customer's autonomous system number (BGP ASN) to the AS_PATH attribute value so that it will be equal to 65001 65001 and the AS path length will be 2. This makes the prefix with such AS path length less preferable for external BGP routers.

This way, for the 0.0.0.0/0 traffic, Yandex Cloud will select the best route via the M9 PoP, while the route via the NORD PoP will act as a failover due to its longer AS path.

All traffic from the cloud subnets to the customer infrastructure will be routed through the private connection to M9. If this connection fails, the traffic will automatically failover to the private connection to NORD.

Was the article helpful?

Previous
Even traffic distribution for route 0.0.0.0/0
Next
VPC Stithcing. Connectivity for two cloud networks
© 2025 Direct Cursus Technology L.L.C.