BGP Best Path Practice

Free BGP best path practice on Cisco IOS rules: read the paths to one prefix, tap the best path, then tap the step that decides it. Check my answer names the slip, such as jumping to AS path before local preference or comparing MED across different neighbouring ASes.

Problem 1

Which path is best, and which step decides it?

Paths to 10.20.0.0/16
Deciding step

Answer to see the working.

These are Cisco IOS rules, and weight is Cisco specific. The step numbers are Cisco's: steps 9, 10 and 12 (multipath, oldest external path, cluster list) are left out. The paths are made up for practice.

Administrative distance is a different comparison from the eBGP over iBGP step. Practise it with route selection practice.

Practise the exams

Studying for a Cisco routing exam? Start with the free real exam questions, then get the full pack.

Cisco ENARSI 300-410620 real exam questions · US$39
Free: 113 questionsGet the full pack
Cisco ENCOR 350-4011,066 real exam questions · US$39
Free: 266 questionsGet the full pack
Cisco SPCOR 350-501515 real exam questions · US$39
Free: 99 questionsGet the full pack
Cisco SPRI 300-510264 real exam questions · US$39
Free: 40 questionsGet the full pack

BGP best path FAQ

What is the BGP best path order on Cisco IOS?

Cisco lists it as: highest weight, highest local preference, locally originated, shortest AS path, lowest origin type, lowest MED, eBGP over iBGP, lowest IGP metric to the next hop, the multipath check, the oldest external path, lowest router ID, shortest cluster list, and lowest neighbour address.

Is local preference or AS path checked first?

Local preference. A path with a higher local preference wins even when its AS path is longer. AS path length is only compared when weight and local preference are level and neither path is locally originated.

Does eBGP beat iBGP before local preference?

No. Preferring eBGP over iBGP is step 7 in Cisco's list. Weight, local preference, locally originated, AS path, origin and MED all come before it, so an iBGP path with a higher local preference wins over an eBGP path.

When is MED compared?

Cisco says the comparison only occurs if the first (the neighbouring) AS is the same in the two paths. Between paths from different neighbouring ASes, MED is skipped and the next step decides. The bgp always-compare-med command changes that, and this drill leaves it out.

Which BGP origin wins?

The lowest origin type. Cisco puts IGP below EGP and EGP below incomplete, so a path with origin IGP wins over a path with origin incomplete.

What are the default weight and local preference?

On a Cisco router, paths that the router originates have a weight of 32,768 by default and other paths have a weight of 0. The default local preference is 100. Weight is Cisco specific and local to the router.

Is a higher or lower router ID better?

Lower. Cisco prefers the route that comes from the BGP router with the lowest router ID, and after that the path that comes from the lowest neighbour address.

What happens to a path whose next hop is inaccessible?

The router ignores it. Cisco lists paths for which the NEXT_HOP is inaccessible among the paths that are not candidates for the best path, whatever their weight or local preference.

Why does the drill have no oldest path step?

Cisco's step 10 prefers the external path that was received first, and a table does not show that. The drill never leaves two eBGP paths level after the IGP metric, so that step is never needed.

Is the order the same in the BGP standard?

Not fully. Weight is Cisco specific, and RFC 4271 has no weight step. Its tie breaking runs through AS path length, origin, MED between routes from the same neighbouring AS, EBGP over IBGP, interior cost, lowest BGP Identifier and lowest peer address.

Sources
  • Cisco, Select BGP Best-path Algorithm (Document ID 13753, updated 28 April 2026): the order of the steps, MED compared only when the neighbouring AS is the same, paths with an inaccessible next hop ignored, and the worked example that ends on the lower router ID.
  • Cisco, BGP Case Studies (Document ID 26634): a weight of 32,768 by default for paths the router originates and 0 for other paths, the default local preference of 100, and the origin codes.
  • IETF, RFC 4271, A Border Gateway Protocol 4, section 9.1.2.2: the vendor neutral tie breaking, which has no weight step.
  • Checked 21 November 2026. The tool's own approach: the paths, AS numbers and addresses are invented, an eBGP path is shown with an IGP metric of 0, and the deciding step is the step that removes the last other path. Left out: AIGP, confederations, AS sets, route reflectors, multipath, the oldest external path step, and the commands that change the order such as bgp always-compare-med and bgp deterministic-med. An independent re-solver that reads only the table agreed with the drill on 12,000 generated problems, for every order of the list. This is an independent practice tool, not made or endorsed by Cisco.

Checked 21 November 2026 against Cisco's Select BGP Best-path Algorithm document (ID 13753).

More free tools

All free tools