BGP Path Selection: The Prepend That Never Worked
AS 200 prepends to steer traffic in through R3, and AS 100 ignores it. Walk the BGP best-path algorithm and fix the policy on four real routers, right below.
Symptom
AS 200 prepends its AS-path to steer traffic in through R3, and R1 ignores it. Walk the best-path algorithm and fix the policy on four real routers without losing the backup path.
Your mission
Prove the cause, then fix it
Format
Four real routers
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.
Create a free account to open BGP Path Selection: The Prepend That Never Worked. You get the root cause and the full step-by-step fix.
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
AS 100 (R1 and R2) connects to AS 200 (R3 and R4) over two eBGP links. AS 200 prepends its AS-path on the R2 to R4 link so that AS 100 sends traffic in through R3. R1 has both paths to R4's loopback, the shorter AS-path through R3 is right there, and R1 still picks the path through R2.
What you'll practice
- Read eBGP and iBGP sessions between two autonomous systems
- Walk the BGP best-path algorithm in order on real routes
- Find a local preference override that outranks a shorter AS-path
- Apply a policy change to routes already received with a soft reset
- Explain why a whole AS follows one router's best path over iBGP
- Prove the fix keeps the path through R2 as the BGP backup when R1's link to R3 fails
1. Order matters more than the attribute
BGP compares weight, then local preference, then locally originated routes, then AS-path length. The first attribute that differs decides, so a higher local preference wins however long its AS-path is.
2. Prepending is a request
AS-path prepending makes a path look longer to other autonomous systems. It only works while the receiving AS leaves local preference and weight equal, because both are compared first.
3. Policy changes need a soft reset
Changing an inbound policy does not change routes already in the BGP table. clear ip bgp * soft in asks the neighbors to send them again, through the new policy.
4. iBGP spreads one router's choice
A router never advertises a route learned over iBGP to another iBGP peer. Once R1 prefers its eBGP path, it advertises it to R2, and R2 prefers it over its own eBGP link because its AS-path is shorter.
The topology
Four real routers. R1 and R2 form AS 100, R3 and R4 form AS 200, with iBGP inside each AS and eBGP on the R1 to R3 and R2 to R4 links. Each router advertises its loopback. R4 prepends 200 200 on its session to R2.
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 4.4.4.4show ip bgp summaryshow running-config | section router bgptraceroute 4.4.4.4 source Loopback0Rate this lab
No ratings yet
Frequently asked
Are these real routers or a simulation?
Real routers. Pressing Start boots four routers just for you, with full command sets: any valid command works, not only the ones the guide suggests. The first start can take a minute or two while the lab server wakes up.
Who can run this lab?
It is included with the Exam Pass and the Year Pass. Each session lasts up to three hours, and you can run one live lab at a time.
Does my exact fix have to match the answer?
No. The lab is scored from what the routers actually do (which path is best, its local preference, where R2 exits and whether the backup takes over), never from which commands you typed. Any correct fix passes, and the tempting partial fixes do not.
Which ENARSI topics does it cover?
BGP neighbor relationships, the best-path selection algorithm, local preference, AS-path prepending and route-maps, from the Layer 3 technologies section of the 300-410 blueprint.
Ready to run this lab yourself?
No setup, no image sourcing. Book a session or ask for a live demo.