Module H – BGP Best Path Selection
A BGP router may receive multiple paths for the same destination prefix. Best-path selection evaluates candidate paths according to an ordered decision process. The exact sequence and tie-breakers can vary by vendor, platform, software release and configuration.
Common Cisco IOS/IOS-XE decision sequence
| Implementation note This is a common Cisco teaching sequence, not a universal exhaustive algorithm. Validate the target device's documentation and configuration before treating a tie-breaker as a test oracle. |
|---|
Weight
Weight is Cisco-specific, local to the router and not advertised to BGP peers. Higher Weight is preferred.
router bgp 65001
neighbor 11.1.1.2 weight 300
!
! Alternative using a route map
route-map SET-WEIGHT permit 10
set weight 300
Worked comparison
| Path | LOCAL_PREF | AS_PATH | MED | Result |
|---|---|---|---|---|
| A | 200 | 65002 65003 65004 | 100 | Wins over B if earlier criteria tie because LOCAL_PREF is higher. |
| B | 100 | 65005 | 50 | Shorter AS_PATH and lower MED do not override Path A's higher LOCAL_PREF. |
Multipath
BGP normally selects one best path, but configured multipath can install multiple eligible paths for forwarding. Eligibility and equivalence requirements depend on the platform and feature configuration.
router bgp 65001
maximum-paths 2
!
show ip bgp <prefix>
show ip route <prefix>
show ip cef <destination>
BGP table, RIB and forwarding plane
| Component | Meaning |
|---|---|
| BGP table | Contains BGP paths received and evaluated, including non-best paths where retained. |
| RIB / IP routing table | Contains routes selected for installation by the routing system. |
| CEF / forwarding table | Contains forwarding information used by the data plane. |
Troubleshooting workflow
Useful commands
show ip bgp
show ip bgp <prefix>
show ip bgp summary
show ip route <prefix>
show ip cef <destination>
show running-config | section router bgp
Senior QA test ideas
Student Knowledge Assessment – Module H
Q1. What is the primary purpose of BGP best-path selection?
A. Establish TCP sessions
B. Select a preferred route among candidate paths
C. Assign IP addresses
D. Discover neighbours
Correct answer: B. Select a preferred route among candidate paths Explanation: BGP evaluates candidate paths and selects a preferred path.
Q2. Which attribute is Cisco-specific and locally significant?
A. AS_PATH
B. MED
C. Weight
D. ORIGIN
Correct answer: C. Weight Explanation: Weight is Cisco-specific and is not advertised to BGP neighbours.
Q3. Which Weight value is preferred?
A. 100
B. 200
C. 50
D. Higher value
Correct answer: D. Higher value Explanation: The highest Weight is preferred.
Q4. Which LOCAL_PREF value is preferred?
A. 50
B. 100
C. 200
D. Lowest value
Correct answer: C. 200 Explanation: Higher LOCAL_PREF is preferred.
Q5. Path A has LOCAL_PREF 200 and AS_PATH length 3. Path B has LOCAL_PREF 100 and AS_PATH length 1. Which wins?
A. Path A
B. Path B
C. Both always win
D. Neither
Correct answer: A. Path A Explanation: LOCAL_PREF is evaluated before AS_PATH; Path A wins.
Q6. If earlier attributes tie, which AS_PATH is generally preferred?
A. Longer
B. Shorter
C. More communities
D. Higher MED
Correct answer: B. Shorter Explanation: A shorter AS_PATH is generally preferred.
Q7. Which ORIGIN type is preferred?
A. INCOMPLETE
B. EGP
C. IGP
D. All equal
Correct answer: C. IGP Explanation: IGP has the lowest ORIGIN code and is preferred.
Q8. Which MED value is normally preferred when compared?
A. 200
B. 150
C. 100
D. 50
Correct answer: D. 50 Explanation: Lower MED is preferred when MED comparison applies.
Q9. When earlier criteria tie, which route type is generally preferred by Cisco?
A. iBGP
B. eBGP
C. Static
D. OSPF
Correct answer: B. eBGP Explanation: Cisco generally prefers eBGP over iBGP at this stage.
Q10. What is hot-potato routing?
A. Highest AS_PATH
B. Lowest IGP cost to next hop
C. Highest MED
D. Highest Weight
Correct answer: B. Lowest IGP cost to next hop Explanation: Hot-potato routing prefers the closest exit based on internal IGP cost.
Q11. What is BGP Multipath?
A. Multiple TCP sessions to one peer
B. Installing multiple eligible paths for a prefix
C. Increasing AS_PATH
D. Disabling best-path
Correct answer: B. Installing multiple eligible paths for a prefix Explanation: Multipath can install multiple eligible paths for forwarding.
Q12. Which command displays BGP candidate paths and best-path indicators?
A. show ip interface brief
B. show ip bgp
C. show version
D. show arp
Correct answer: B. show ip bgp
Explanation: show ip bgp displays BGP routes and best-path indicators.
Q13. A route is in BGP table but absent from RIB. What should you check?
A. Hostname
B. Next-hop reachability, best path and RIB installation conditions
C. NTP
D. Interface description
Correct answer: B. Next-hop reachability, best path and RIB installation conditions Explanation: Check validity, best-path status, next-hop reachability and RIB selection.
Q14. What normally happens if the selected best path is withdrawn?
A. BGP always restarts
B. Another eligible path may become best
C. All peers are removed
D. It becomes static
Correct answer: B. Another eligible path may become best Explanation: BGP reevaluates remaining eligible paths.
Q15. Which statement about Weight is correct?
A. Standard attribute advertised to all peers
B. Lower is preferred
C. Cisco-specific and local to router
D. Replaces AS_PATH
Correct answer: C. Cisco-specific and local to router Explanation: Weight is local to a Cisco router and is not propagated to peers.
Appendix 1 – Core CLI Quick Reference
| Command | Use |
|---|---|
| show ip bgp summary | Peer state and prefix count summary. |
| show ip bgp | BGP table, candidate paths and best-path indicators. |
| show ip bgp <prefix> | Inspect attributes and candidate paths for a prefix. |
| show ip bgp neighbors | Neighbour details, capabilities, timers and counters. |
| show ip route bgp | Routes learned through BGP and installed in the RIB. |
| show ip route <prefix> | Selected route and route source. |
| show ip cef <destination> | Forwarding lookup. |
| show running-config | section router bgp | BGP configuration section. |
| show tcp brief | TCP connection information, useful for port 179 checks. |
| show logging | Review BGP state changes and error messages. |
Appendix 2 – QA Evidence Record Template
| Field | Record |
|---|---|
| Test ID | |
| Module / feature | |
| Device / software version | |
| Topology / peer details | |
| Preconditions | |
| Configuration applied | |
| Test steps | |
| Expected result | |
| Actual result | |
| CLI / packet capture evidence | |
| Pass / Fail | |
| Defect / observation | |
| Tester / date |
Appendix 3 – Technical Accuracy Notes
Part 1 Completion Record
Modules A–H form the complete Basic BGP Theory learning sequence for SP Networking Academy. The next learning track can extend into Advanced BGP Theory, followed by interview preparation and practical lab exercises.
| Module | Topic | Status |
|---|---|---|
| A | BGP Fundamentals | Approved |
| B | Autonomous Systems and ASN Architecture | Approved |
| C | eBGP and iBGP | Approved |
| D | BGP Neighbour Relationships | Approved |
| E | BGP Message Types | Approved |
| F | BGP Finite State Machine | Approved |
| G | BGP Path Attributes | Approved |
| H | BGP Best Path Selection | Approved |