Question · DNS & Networking

How exactly does BGP select the best path among multiple options?

6 Mar 2026
I'm studying for a networking exam and trying to wrap my head around BGP path selection. I get that it uses a complex decision process when multiple routes to the same prefix exist, but I'm getting lost in the specifics. I've looked at the attributes like AS_PATH and LOCAL_PREF, but I'm fuzzy on the complete order of operations. Could someone break down the full step-by-step process BGP uses to choose the best path? Knowing the exact sequence would really help solidify my understanding.
Best answer
BGP selects the best path by evaluating a strict sequence of attributes, proceeding to the next step only if the previous one results in a tie. The process begins by preferring the path with the highest WEIGHT (a Cisco-specific, locally significant value), then the highest LOCAL_PREF (the globally significant indicator of preference within an AS). If these are equal, it prefers locally originated routes (via `network` or `aggregate` commands) over learned ones. Next, it selects the path with the shortest AS_PATH. Subsequent steps involve comparing ORIGIN type (IGP is preferred over EGP, which is preferred over INCOMPLETE), the lowest MULTI_EXIT_DISC (MED), eBGP-learned paths over iBGP, and finally the path with the lowest IGP metric to the next-hop. The underlying concept is to prioritize administrative policy (WEIGHT, LOCAL_PREF) first, then the most efficient and stable routing path (AS_PATH length, MED), ensuring deterministic path selection across networks.

You can view the attributes BGP uses for a specific route and its selection process using:
show ip bgp <network>
show ip bgp <network> | include Metric
7 Mar 2026
Your answer Sign in or register to reply

This is a public discussion. Create a free account to answer. Takes 20 seconds. No email gates.

Who Is Online

In total there are 74 users online: 0 registered, 67 guests and 7 bots.

Most users ever online was 5,555 on 17 Jul 2026, 3:23 am.

Bots: AhrefsBot Applebot Baiduspider Bingbot Other Bot PetalBot SemrushBot

Users active in the past 15 minutes. Total registered members: 369