<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/use-disaggregated-prefixes-to-select-the-primary-link-bgp-labs-j8ovgczqv" -->

---
title: Use Disaggregated Prefixes to Select the Primary Link «...
description: A hands-on BGP lab exercise demonstrating prefix disaggregation as a last-resort technique for controlling inbound traffic flow. When an ISP (X2) uses BGP...
canonical: https://daily.dev/posts/use-disaggregated-prefixes-to-select-the-primary-link-bgp-labs-j8ovgczqv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Use Disaggregated Prefixes to Select the Primary Link « BGP Labs | daily.dev
og:description: A hands-on BGP lab exercise demonstrating prefix disaggregation as a last-resort technique for controlling inbound traffic flow. When an ISP (X2) uses BGP...
og:url: https://daily.dev/posts/use-disaggregated-prefixes-to-select-the-primary-link-bgp-labs-j8ovgczqv
og:image: https://api.daily.dev/og/posts/J8OvgczqV.png
og:image:alt: Use Disaggregated Prefixes to Select the Primary Link « BGP Labs
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Disaggregated Prefixes to Select the Primary Link « BGP Labs

**[ipSpace.net Blog](https://daily.dev/sources/ipspace)** · 6 min read · 0 upvotes · 0 comments

## Summary

A hands-on BGP lab exercise demonstrating prefix disaggregation as a last-resort technique for controlling inbound traffic flow. When an ISP (X2) uses BGP local preference to prefer direct customer routes and ignores AS-path prepending or BGP communities, the only way to force traffic via the primary link (X1) is to advertise more-specific prefixes (/23s) to X1 while advertising only the aggregate (/22) to X2. The lab walks through configuring prefix origination and outbound prefix-list filters on EBGP sessions, with verification steps using FRRouting or Arista EOS via the netlab toolchain.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.ipspace.net/2024/12/bgp-labs-disaggregated-prefixes>

## Questions this post answers

### How can I force a backup ISP to route traffic through my primary ISP when the backup uses local preference and ignores AS-path prepending?

Advertise two more-specific prefixes (e.g., /23s) to the primary ISP and only the aggregate prefix (e.g., /22) to the backup ISP. Because more-specific routes always win in BGP route selection, the backup ISP will prefer the path learned via the primary ISP for the more-specific prefixes. This technique is called prefix disaggregation and should be a last resort, as it adds entries to global routing tables.

_Engineers navigating stubborn ISP routing policies track BGP techniques like this on daily.dev._

### Why doesn't AS-path prepending work to shift inbound traffic away from a link when the ISP uses local preference?

AS-path prepending loses to local preference in BGP's decision process. If an ISP assigns a higher local preference to directly connected customer routes (e.g., localpref 200 vs. the default 100), the local preference attribute is evaluated before AS-path length, so prepending extra AS hops has no effect on that ISP's path selection.

_Keeping up with BGP policy edge cases like this is easier when the right posts surface on daily.dev._

## Similar posts on daily.dev

- [Enforcing the First AS in BGP AS\_PATHs](https://daily.dev/posts/enforcing-the-first-as-in-bgp-as-paths-yx1xiadkj) · Cloudflare · 0 upvotes · 0 comments
- [Multivendor SR-MPLS « ipSpace.net blog](https://daily.dev/posts/multivendor-sr-mpls-ipspace-net-blog-qekokwduk) · ipSpace.net Blog · 0 upvotes · 0 comments
- [The Never-Ending IPv6 Loopback Prefix Saga « ipSpace.net blog](https://daily.dev/posts/the-never-ending-ipv6-loopback-prefix-saga-ipspace-net-blog-4nlhgh10l) · ipSpace.net Blog · 0 upvotes · 0 comments

---

Tags: [#bgp](https://daily.dev/tags/bgp)

[View this post on daily.dev](https://daily.dev/posts/use-disaggregated-prefixes-to-select-the-primary-link-bgp-labs-j8ovgczqv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Use Disaggregated Prefixes to Select the Primary Link « BGP Labs","url":"https://daily.dev/posts/use-disaggregated-prefixes-to-select-the-primary-link-bgp-labs-j8ovgczqv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/use-disaggregated-prefixes-to-select-the-primary-link-bgp-labs-j8ovgczqv"},"datePublished":"2026-08-11T08:52:17.340Z","dateModified":"2026-08-11T08:54:06.770Z","description":"A hands-on BGP lab exercise demonstrating prefix disaggregation as a last-resort technique for controlling inbound traffic flow. When an ISP (X2) uses BGP...","image":"https://media.daily.dev/image/upload/s--ZrL_HSsR--/f_auto/v1722860399/public/Placeholder%2006","thumbnailUrl":"https://media.daily.dev/image/upload/s--ZrL_HSsR--/f_auto/v1722860399/public/Placeholder%2006","isAccessibleForFree":true,"articleSection":"ipSpace.net Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ipSpace.net Blog","logo":"https://media.daily.dev/image/upload/s--xS7E82MT--/f_auto,q_auto/v1786438303/logos/ipspace?_a=BAMAMicg0","url":"https://daily.dev/sources/ipspace"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/use-disaggregated-prefixes-to-select-the-primary-link-bgp-labs-j8ovgczqv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"bgp","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ipSpace.net Blog","item":"https://daily.dev/sources/ipspace"},{"@type":"ListItem","position":3,"name":"Use Disaggregated Prefixes to Select the Primary Link « BGP Labs"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/use-disaggregated-prefixes-to-select-the-primary-link-bgp-labs-j8ovgczqv#faq","mainEntity":[{"@type":"Question","name":"How can I force a backup ISP to route traffic through my primary ISP when the backup uses local preference and ignores AS-path prepending?","acceptedAnswer":{"@type":"Answer","text":"Advertise two more-specific prefixes (e.g., /23s) to the primary ISP and only the aggregate prefix (e.g., /22) to the backup ISP. Because more-specific routes always win in BGP route selection, the backup ISP will prefer the path learned via the primary ISP for the more-specific prefixes. This technique is called prefix disaggregation and should be a last resort, as it adds entries to global routing tables. Engineers navigating stubborn ISP routing policies track BGP techniques like this on daily.dev."}},{"@type":"Question","name":"Why doesn't AS-path prepending work to shift inbound traffic away from a link when the ISP uses local preference?","acceptedAnswer":{"@type":"Answer","text":"AS-path prepending loses to local preference in BGP's decision process. If an ISP assigns a higher local preference to directly connected customer routes (e.g., localpref 200 vs. the default 100), the local preference attribute is evaluated before AS-path length, so prepending extra AS hops has no effect on that ISP's path selection. Keeping up with BGP policy edge cases like this is easier when the right posts surface on daily.dev."}}]}
```

