This BGP best path simulator walks two to four paths for the same prefix through the Cisco IOS best-path algorithm and shows which step decided the winner. It runs entirely in your browser: nothing you type is sent to our server.
Loading the tool… It runs in your browser and needs JavaScript.
Table of Contents
The order of the steps
- Highest weight (Cisco only, local to the router)
- Highest local preference
- Locally originated routes
- Shortest AS path
- Lowest origin (IGP, then EGP, then incomplete)
- Lowest MED (only between paths from the same neighbouring AS, unless always-compare-med)
- eBGP over iBGP
- Lowest IGP metric to the next hop
- Lowest router ID
- Shortest cluster list
- Lowest neighbour address
Why MED surprises people
By default MED is only compared between paths from the same neighbouring AS, so a lower MED from a different provider does nothing. A path without MED counts as 0 (the best) unless you set bgp bestpath med missing-as-worst. The simulator lets you toggle both.
Not modelled: next-hop reachability, AIGP, multipath, the oldest-eBGP-path rule and deterministic-MED grouping. Use it to understand and plan, then confirm with show ip bgp PREFIX.
How we checked it
We checked the simulator on 11-12 October 2026 with sample paths where the decision falls at AS path length, eBGP over iBGP and MED (with and without always-compare-med).
Frequently asked questions
What is the first step in BGP best path selection?
On Cisco, highest weight. Weight is local to the router. The first standard attribute is local preference.
Why is MED ignored?
Because the paths come from different neighbouring ASes. Enable bgp always-compare-med to compare them anyway.
Does a shorter AS path always win?
Only if weight, local preference and local origination are equal; those steps come first.