BGP Multipath

April 6, 2022
6 min read

OrhanErgun

Table of Contents

Quick navigation6 sections

BGP Multipath - by default, BGP installs only a single path in IBGP and EBGP deployment. If prefixes are learned via multiple paths, BGP supports multipath for IBGP, EBGP, or across both IBGP and EBGP via the EIBGP Multipath feature. In this blog post, we will explore each of these options: IBGP Multipath, EBGP Multipath, and EIBGP Multipath.

First of all, we should know that the BGP Multipath feature should be enabled manually on the network device, unlike IGP protocols.

In IGP protocols, when there is Multipath, commonly referred to as ECMP (Equal Cost Multipath), routers install all next-hops for the destination prefixes to the routing and forwarding table automatically, without manual human operation.

We have on the website the most detailed, design and practical hands-on BGP Training in the world.

Let's start with the first one, EBGP Multipath:

EBGP Multipath

Figure - EBGP Multipath

We have two rules for EBGP Multipath:

  1. For the destination prefix, if there is more than one path, the total number of AS - Autonomous System - should be the same across the different paths.
  2. For the destination prefix, if there is more than one path, the same AS numbers should be in the AS Path.

In the above figure, since from AS 100 to the destination prefix 192.168.0.0/24 there are two paths and both have 2 AS-Path lengths, Rule 1 is satisfied.

Also, the AS numbers are the same towards the destination prefix, which is AS 100 - AS 200, and finally the destination.

Let's have a look now at IBGP Multipath:

IBGP Multipath

Figure - IBGP Multipath

For IBGP Multipath, all the other best path selection steps until the Multipath tie-breaker should be the same.

Local Preference, AS-Path Length, Origin, MED - all should be the same. In fact, the IGP cost to the BGP next-hop has to be the same as well.

Then, IBGP Multipath can be enabled manually, and for the destination prefix, both BGP next-hops can be used.

Lastly, let's have a look at EIBGP Multipath:

EIBGP Multipath

Figure - EIBGP Multipath

The BGP best path selection algorithm prefers EBGP paths over IBGP paths.

This prevents having both IBGP and EBGP prefixes installed in the routing table at the same time.

The EIBGP Multipath feature allows the same prefix to be installed both with IBGP and EBGP next hops.

Configuring BGP Multipath on Cisco Routers

After explaining IBGP Multipath, EBGP Multipath, and EIBGP Multipath, let's have a look at a BGP Multipath configuration example on Cisco devices:

Router(config-router)# maximum-paths ibgp maximum-number

This command controls the maximum number of parallel IBGP routes that can be installed in a routing table.

BGP Bestpath AS-Path Multipath-Relax

So what happens if the AS numbers are different across the paths? Let's remember the two EBGP Multipath rules again: the number of ASes has to be the same across the paths, and the AS numbers in the AS Paths have to be the same as well.

Figure - Multipath-Relax Feature

In the above figure, the number of ASes in both of the paths is 2, but the AS numbers are different.

One of the paths is AS 100 - AS 400, and the other path is AS 100 - AS 300.

Thus, across two different paths, as we have different AS numbers - although you have 2 ASes in both of these paths - you cannot do EBGP Multipath by default.

If you want to enable EBGP Multipath even if you have different AS numbers, then you need the bgp bestpath as-path multipath-relax configuration command. With this, basically, you are telling the routers: even if the AS numbers are different across the paths, if the AS Path length is the same, then behave a little bit relaxed and allow EBGP Multipath.

Bonus: this feature is used in CLOS topologies in Hyperscale Datacenters today, and you can find more information about it in RFC 7938.

BGP Load Balancing and BGP ECMP

In this post so far, I have been explaining BGP Multipath for the IBGP Multipath, EBGP Multipath, and EIBGP Multipath features and their usage. Sometimes, network engineers use the BGP Load Balancing or BGP ECMP terms instead of BGP Multipathing. They all are the same thing.

In BGP, we usually don't use the BGP ECMP, BGP Load Balancing, or BGP Load Sharing terms, but we use the BGP Multipath keyword mostly. By highlighting this, I wanted to avoid any future confusion for you.

We have many other BGP posts on the website and we have 35-40 hours of video-based BGP Course on the website.

OrhanErgun

About the Author

OrhanErgun

He created OrhanErgun.Net 10 years ago and has been serving the IT industry with his renowned and awarded training.

Wrote many books, mostly on Network Design, joined many IETF RFCs, gave Public talks at many Forums, and mentored thousands of his students.  

Today, with his carefully selected instructors, OrhanErgun.Net is providing IT courses to tens of thousands of IT engineers.

Share this Article

Related Articles

BGPJuly 18, 2026

What Is BGP? Border Gateway Protocol — The Complete Guide

Border Gateway Protocol (BGP) is the routing protocol that holds the Internet together. Every time a packet crosses from one provider's network to another — from your ISP to a...

Read Article
BGPOctober 15, 2024

Top 30 BGP Interview Questions You Need to Know in Networking

Border Gateway Protocol (BGP) is a fundamental subject for anyone diving into the networking sector, especially for those preparing for job interviews. Whether you are aiming for a role in...

Read Article
BGPOctober 15, 2024

BGP Fundamentals Explained: What You Should Understand Before Your Interview

BGP Fundamentals Explained: What You Should Understand Before Your Interview Heading into a job interview that involves discussing network technologies can be daunting. Among the various protocols you need to...

Read Article
BGPSeptember 7, 2024

Understanding BGP: What Port Does it Use and Why?

Ever wondered how the colossal network of the internet is managed? Or how data finds its way across complex networks reliably and efficiently? A significant part of the answer lies...

Read Article
BGPSeptember 7, 2024

Choosing the Right BGP Router ID: Best Practices

When managing complex network topologies, the selection of an efficient Border Gateway Protocol (BGP) Router ID becomes imperative. This decision can significantly impact the stability and performance of your network....

Read Article
BGPSeptember 7, 2024

BGP Split Horizon vs Route Poisoning: What's the Difference?

In the robust universe of network routing, understanding the mechanisms that prevent routing loops is crucial for maintaining network reliability and efficiency. Two prominent techniques used in Border Gateway Protocol...

Read Article

Subscribe for Exclusive Deals & Promotions

Stay informed about special discounts, limited-time offers, and promotional campaigns. Be the first to know when we launch new deals!