Skip to content
Back to Learning
CCNP · ENARSIAdvanced

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.

Simulated labRoutingBGPPath Selection

Symptom

eBGP and iBGP sessions, the best-path algorithm, and policy via local-preference and AS-path prepending.

Your mission

Inspect, recover, then verify

Format

Cisco IOS CLI

BGP: The Longer AS-Path Keeps Winning

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.

Locked

Create a free account to open BGP Peering & Path Selection. You get the root cause and the full step-by-step fix.

Already have an account? Sign in

No spam. The fix lands in your inbox too. Your account includes 5 guided labs free. After that, the Learning Pass unlocks every remaining lab.

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 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

  • Read eBGP and iBGP sessions between two autonomous systems
  • Walk the BGP best-path algorithm step by step on real routes
  • Influence path selection with local-preference and AS-path prepending
  • Read show ip bgp to see which attribute chose the best path
  • Find a local-preference override that beats a shorter AS path

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.

Compare both candidate paths
show ip bgp 172.16.0.0
Read the neighbor policy
show running-config | section router bgp
Inspect the route-map
show route-map PREFER-TRANSIT

Topology diagram

Inside a real session

More genuine captures from this lab running on the platform, at full size so the console text stays readable.

The BGP path selection lab open in PNETLab: R1 and R2 in AS 100, R3 and R4 in AS 200, plus symptom, objectives, checklist and topology facts cards
The lab as it opens in PNETLab: two autonomous systems, two eBGP paths, and the facts you need to compare them.

Rate this lab

No ratings yet

Your rating

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.