← Back to Part 1 Modules
PART 1 · BASIC BGP THEORY · MODULE G

Module G – BGP Path Attributes

Lesson content presented from the approved Part 1 master documentation.

Module G – BGP Path Attributes

Path attributes are information carried with BGP routes. They describe route origin and path, identify next-hop information, support loop prevention and influence routing policy and best-path selection.

Four attribute categories

CategoryMeaningExamples
Well-known mandatoryMust be recognized and must be present where required in UPDATEs carrying reachable NLRI.ORIGIN, AS_PATH, NEXT_HOP
Well-known discretionaryMust be recognized but need not appear in every UPDATE.LOCAL_PREF, ATOMIC_AGGREGATE
Optional transitiveMay not be recognized by every implementation but is generally propagated onward when appropriate.COMMUNITY, AGGREGATOR
Optional non-transitiveMay not be recognized and generally is not propagated beyond the receiving BGP speaker.MED

Core attributes

AttributePurpose / behaviour
ORIGINIdentifies how the route entered BGP: IGP (0), EGP (1), INCOMPLETE (2). A BGP network statement normally gives IGP origin; redistribution normally gives INCOMPLETE.
AS_PATHRecords AS traversal. A router normally rejects a route containing its own ASN. Shorter paths are generally preferred after higher-priority criteria.
NEXT_HOPIdentifies the next-hop address. It must be resolvable for the route to be usable.
LOCAL_PREFInfluences preferred exit from an AS. Higher is preferred; normally propagated within the AS through iBGP, not to eBGP peers.
MEDSuggests a preferred entry point into an AS. Lower is preferred when compared; comparison scope is platform/configuration dependent.
COMMUNITYTags routes so policy can be applied to groups of prefixes. Well-known communities include NO_EXPORT and NO_ADVERTISE.
ATOMIC_AGGREGATE / AGGREGATORProvide information related to route aggregation and the aggregator.
ORIGINATOR_ID / CLUSTER_LISTSupport loop prevention and route tracking in route-reflector environments.

AS_PATH prepending

AS_PATH prepending adds repeated occurrences of an ASN to make a route appear longer to remote ASes. It can influence remote inbound path selection, but other policy attributes may override the effect.

route-map PREPEND permit 10
 set as-path prepend 65001 65001 65001
!
router bgp 65001
 neighbor 11.1.1.2 route-map PREPEND out

NEXT_HOP and next-hop-self

An eBGP-learned route advertised to an iBGP peer normally retains its original next hop. If that next hop is not reachable inside the AS, the receiving router may not use the route. next-hop-self changes the advertised next hop to the local router for the specified neighbour.

router bgp 65002
 neighbor 12.1.1.2 next-hop-self

LOCAL_PREF and MED comparison

AttributeTraffic engineering directionPreference
LOCAL_PREFPreferred exit from own ASHigher
MEDSuggested entry into own AS from neighbourLower, when compared

COMMUNITY examples

route-map TAG-ROUTE permit 10
 set community no-export
!
router bgp 65001
 neighbor 11.1.1.2 send-community

NO_EXPORT prevents advertisement beyond the applicable local AS/confederation boundary. NO_ADVERTISE prevents advertisement to any BGP peer. Confirm community propagation and policy behaviour on the target implementation.

Verification commands

show ip bgp
show ip bgp <prefix>
show ip bgp neighbors
show ip route <prefix>

Senior QA test ideas

  • Verify ORIGIN for network-statement and redistributed routes.
  • Verify AS_PATH propagation, loop rejection and prepending.
  • Verify eBGP and iBGP NEXT_HOP behaviour; test next-hop-self.
  • Compare LOCAL_PREF values and confirm higher preference.
  • Compare MED values under the configured MED comparison rules.
  • Apply communities and verify the resulting advertisement policy.
  • Student Knowledge Assessment – Module G

    Q1. Which attribute records the sequence of AS numbers traversed?

    A. LOCAL_PREF

    B. AS_PATH

    C. MED

    D. ORIGIN

    Correct answer: B. AS_PATH Explanation: AS_PATH records the AS sequence and supports loop prevention.

    Q2. Which attribute influences the preferred exit within an AS?

    A. MED

    B. COMMUNITY

    C. LOCAL_PREF

    D. NEXT_HOP

    Correct answer: C. LOCAL_PREF Explanation: LOCAL_PREF influences outbound path selection within an AS.

    Q3. Which LOCAL_PREF value is preferred?

    A. 50

    B. 100

    C. 200

    D. Lower value

    Correct answer: C. 200 Explanation: Higher LOCAL_PREF is preferred.

    Q4. 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 the comparison applies.

    Q5. What does ORIGIN IGP indicate?

    A. Route learned from OSPF

    B. Route originated using BGP network statement

    C. Route learned from EIGRP

    D. Route learned from iBGP

    Correct answer: B. Route originated using BGP network statement
    Explanation: IGP origin identifies BGP network-statement origination, not learning from an IGP.

    Q6. Which ORIGIN value is normally associated with redistribution?

    A. IGP

    B. EGP

    C. INCOMPLETE

    D. LOCAL

    Correct answer: C. INCOMPLETE Explanation: Redistributed routes normally receive INCOMPLETE origin.

    Q7. What happens if a router receives its own ASN in AS_PATH?

    A. It prefers the route

    B. It prepends its ASN

    C. It rejects the route as a loop

    D. It changes MED

    Correct answer: C. It rejects the route as a loop Explanation: The router rejects the route to prevent an AS-level loop.

    Q8. What does next-hop-self do?

    A. Changes peer ASN

    B. Advertises local router as next hop

    C. Disables next-hop checking

    D. Changes LOCAL_PREF

    Correct answer: B. Advertises local router as next hop Explanation: It advertises the local router as next hop to the specified neighbour.

    Q9. Which attribute is used for route tagging and policy?

    A. COMMUNITY

    B. ORIGIN

    C. NEXT_HOP

    D. AS_PATH

    Correct answer: A. COMMUNITY Explanation: COMMUNITY tags routes for policy treatment.

    Q10. Which community prevents advertisement to any BGP peer?

    A. NO_EXPORT

    B. NO_ADVERTISE

    C. LOCAL_PREF

    D. AS_TRANS

    Correct answer: B. NO_ADVERTISE Explanation: NO_ADVERTISE prevents advertisement to any BGP peer.

    Q11. Which is a well-known mandatory attribute?

    A. MED

    B. COMMUNITY

    C. AS_PATH

    D. AGGREGATOR

    Correct answer: C. AS_PATH Explanation: AS_PATH is well-known mandatory.

    Q12. Which attribute is optional non-transitive?

    A. AS_PATH

    B. MED

    C. ORIGIN

    D. LOCAL_PREF

    Correct answer: B. MED Explanation: MED is optional non-transitive.

    Q13. What is AS_PATH prepending used for?

    A. Reduce TCP timers

    B. Make a route appear longer

    C. Change next hop

    D. Establish iBGP

    Correct answer: B. Make a route appear longer Explanation: Repeated ASNs make the path appear longer to remote ASes.

    Q14. A route is in the BGP table but not the IP routing table. What should be investigated?

    A. Hostname

    B. Best-path status and next-hop reachability

    C. Router banner

    D. Console password

    Correct answer: B. Best-path status and next-hop reachability Explanation: Check route validity, best-path status, next-hop resolution and RIB selection.

    Q15. Which attribute suggests an entry-path preference to a neighbouring AS?

    A. LOCAL_PREF

    B. MED

    C. ORIGIN

    D. CLUSTER_LIST

    Correct answer: B. MED Explanation: MED communicates a suggested preferred entry point into the advertising AS.

    Source and assessment note

    Technical explanations, tables, examples, QA scenarios and assessments are presented from the approved Part 1 master documentation. Verify illustrative CLI syntax against the target router platform and software release before lab or production use.