BGP Peering & Path Selection
A shorter AS-path that never wins. Walk the best-path algorithm in order and find what outranks it, live, right below.
Symptom
eBGP and iBGP sessions, the best-path algorithm, and policy via local-preference, AS-path and communities.
Your mission
Inspect, recover, then verify
Format
Cisco IOS CLI
Investigate before you configure.
Use the CLI evidence to isolate the fault, make the smallest safe correction, then verify the network state changed.
Observe the symptom and link state.
Diagnose by comparing the protocol evidence.
Verify the expected device state and confirm the original symptom is resolved.
Console access: R1
This workspace stacks for portrait phones. Rotate to landscape for the full split-screen console.
Need a hint?
Reveal the root cause when you're ready.
Try the investigation first, then use this as your escape hatch, not a dead end.
Lab debrief
Turn the session into a repeatable troubleshooting pattern.
Use this reference after your attempt: first explain the symptom, then verify the evidence, then confirm the repair.
The problem
Two eBGP paths exist to the same prefix, one with a visibly shorter AS-path, but the router keeps selecting the longer one as best. Nothing about the configuration looks obviously wrong at first glance.
What you'll practice
- Establish eBGP and iBGP peering sessions between routers
- Walk the BGP best-path algorithm step by step on real routes
- Influence path selection with local-preference and AS-path prepending
- Tag and filter routes using BGP communities
- Diagnose a stuck or flapping BGP session
The topology
Four routers form two autonomous systems connected by dual eBGP links, with an iBGP session inside each AS, enough redundancy to force real best-path decisions instead of one obvious route.
Commands to run yourself
The real diagnostic commands for this lab, copy-paste ready. Run these in the same order to reproduce the investigation on your own session.
show ip bgp 172.16.0.0show running-config | section router bgpshow route-map PREFER-TRANSITTopology diagram
Fact-checked references
The commands and behaviour in this lab were checked against these primary references.
Frequently asked
Do I need to build the BGP peering topology myself?
No. The peering topology, IOS images and base configs are pre-built. You configure policy, not infrastructure.
Is this suitable for CCNP or just CCIE-level BGP?
It's scoped to CCNP ENARSI BGP topics (peering, best-path, policy), advanced enough to also warm up for CCIE-level BGP practice.
Ready to run this lab yourself?
No setup, no image sourcing. Book a session or ask for a live demo.