Today’s Question

Try to answer before scrolling to the reveal. This is the kind of question that appears on CCNA 200-301, CompTIA Network+ N10-009, and AWS ANS-C01 exams:

Question of the Day — BGP

A router running BGP has two paths to the same destination prefix. Both paths have identical Local Preference and AS Path length. Which BGP attribute is evaluated first — before Local Preference — to select the best path?

  • A. MED (Multi-Exit Discriminator)
  • B. Origin code (IGP > EGP > incomplete)
  • C. Weight
  • D. Router ID
Answer Reveal

C. Weight is evaluated first. Weight is a Cisco-proprietary attribute that is local to the router only — it is never advertised to peers. The higher the Weight, the more preferred the path. Because it never leaves the local router it is the easiest knob to pull for traffic engineering without affecting the rest of the network.

The Full BGP Best-Path Algorithm

BGP compares candidate paths in a fixed order. The moment two paths differ on an attribute, the comparison stops and a winner is declared. Here is the standard Cisco IOS order — worth memorising as a sequence, not just a list:

# Attribute Prefer Scope
1 Weight Higher Local router only (Cisco)
2 Local Preference Higher Within the AS
3 Locally originated Local wins network/redistribute vs iBGP learned
4 AS Path length Shorter Exchanged between ASes
5 Origin code IGP > EGP > ? How the prefix entered BGP
6 MED Lower Hint to neighbouring AS
7 eBGP over iBGP eBGP wins
8 IGP metric to next-hop Lower Interior path cost
9 Router ID Lower Last tiebreaker

A common mnemonic taught in CCNA bootcamps is We Love Oranges As Oranges Mean Pure Refreshment (Weight, Local-pref, Originated, AS-path, Origin, MED, Paths-eBGP/iBGP, Router-ID). Use whichever helps it stick.

Why Each Attribute Exists

Weight — The Local Override

Weight defaults to 32768 for routes originated by the local router and 0 for routes learned from peers. Because it is never propagated, a network engineer can set Weight on a single router to steer traffic out a preferred link without touching route policies on any other device. It is powerful precisely because its blast radius is zero.

Local Preference — The AS-Wide Signal

Local Preference travels with routes inside an Autonomous System via iBGP. The default value is 100. Raising it on routes received from a preferred upstream provider tells every router in the AS to exit there. This is how large networks implement primary/backup ISP policies: primary uplink gets local-pref 200, backup gets local-pref 100.

AS Path — The Distance Proxy

AS Path lists every AS a route has traversed. BGP prefers shorter paths, which usually (but not always) means fewer hops. AS Path prepending — artificially appending your own AS number multiple times — is the standard way to make a link look less attractive to remote peers without changing any attribute on their side.

MED — The Polite Suggestion

MED (Multi-Exit Discriminator) is only compared between paths from the same neighbouring AS by default. It is a hint from one AS to another saying “please enter our network here rather than there.” Remote ASes are free to ignore it. Because it is only compared within the same peer AS, MED trips up many candidates who expect it to behave like a universal metric.

Where Exam Questions Go Wrong

Most incorrect answers on this topic fall into three traps:

Real-World Example: Dual-ISP Design

Imagine a company with two upstream providers — ISP-A (primary, 10 Gbps) and ISP-B (backup, 1 Gbps). Both advertise a default route into the company’s eBGP session. Here is how each attribute layer is used in practice:

This layered approach is exactly what AWS ANS-C01 tests when it asks about hybrid connectivity, Direct Connect with VPN failover, and BGP route preferences in Transit Gateway routing tables.

Relevant Certifications

BGP path selection shows up across multiple certification tracks at different depths:

If you want to test yourself with more questions at this depth, the CCNA practice pack on CertQuests has 110 questions covering routing protocols, switching, and automation. The AWS ANS-C01 pack goes deeper on BGP in hybrid cloud scenarios.