Post

BGP Attributes

BGP Attributes

⚡ BGP Path Attributes — Quick Revision Notes

📘 Goal: Fast-track learning & interview-ready reference for the 5 most important BGP attributes.


🧱 1. AS_PATH (Type Code: 2)

PropertySummary
ClassificationWell-known Mandatory
PurposeLists all AS numbers the route has passed through → used for loop prevention & best path
StructureOrdered AS_SEQUENCE, unordered AS_SET (used in aggregation)
Best Path RulePrefer shortest AS_PATH
Manipulationset as-path prepend <asn> → makes path longer, less preferred (controls inbound traffic)
Transitivity✅ Yes (carried in UPDATEs)
NotesLoop prevention + Inbound TE tool

🌉 2. NEXT_HOP (Type Code: 3)

PropertySummary
ClassificationWell-known Mandatory
PurposeIdentifies the next router IP to reach the destination prefix
BehavioreBGP → next-hop = neighbor IP
iBGP → next-hop unchanged
Manipulationneighbor <ip> next-hop-self → make local router next-hop
RequirementMust be reachable in local routing table
Transitivity✅ Yes
NotesEnsures correct forwarding — key for iBGP reachability

🌐 3. ORIGIN (Type Code: 1)

PropertySummary
ClassificationWell-known Mandatory
PurposeShows how route entered BGP (source of origination)
Codesi (IGP – network statement)
e (EGP – old protocol)
? (Incomplete – redistribution)
Preference OrderIGP (i) > EGP (e) > Incomplete (?)
Manipulationset origin igp / set origin incomplete
Transitivity✅ Yes
NotesAffects internal preference; used in best-path Step #7

⚖️ 4. WEIGHT (Cisco Proprietary)

PropertySummary
ClassificationOptional Non-Transitive (local only)
PurposeDetermines local outbound route preference (first best-path step)
Range0–65,535 → higher = more preferred
Default32,768 (local) / 0 (learned)
Manipulationset weight <value> or neighbor <ip> weight <value>
Transitivity❌ No
NotesLocal router only → controls local exit traffic

🏛️ 5. LOCAL_PREFERENCE (LOCAL_PREF) (Type Code: 5)

PropertySummary
ClassificationWell-known Discretionary
PurposeDefines AS-wide outbound preference (second best-path step)
Default100
RuleHigher LOCAL_PREF = more preferred exit
Manipulationset local-preference <value> or neighbor <ip> local-preference <value>
Propagation✅ iBGP only (not sent to eBGP)
NotesControls outbound routing for the entire AS

🧠 BGP Best Path Order (Top 5 Steps)

StepAttributeRule
1️⃣WeightHigher = better
2️⃣Local PreferenceHigher = better
3️⃣Locally originatedPreferred over learned
4️⃣AS_PATHShorter = better
5️⃣OriginIGP > EGP > Incomplete

🧾 Quick Summary

AttributeInfluenceScopeTransitiveTypical Use
⚖️ WeightOutboundLocal Router❌ NoLocal path control
🏛️ Local PrefOutboundEntire AS✅ Internal onlyAS exit preference
🧱 AS_PATHInboundGlobal✅ YesLoop prevention, inbound TE
🌐 OriginInternalGlobal✅ YesRoute source & preference
🌉 Next HopForwardingGlobal✅ YesEnsures reachability

⚙️ Tip:

  • Weight & Local Pref → Outbound control
  • AS_PATH → Inbound control
  • NEXT_HOP → Reachability
  • ORIGIN → Preference hint

🧩 Perfect For:
CCNA/CCNP/ENARSI Learners | Network Engineers | Interview Quick Revision


🙌 Connect With Me

GitHub LinkedIn YouTube Gmail

This post is licensed under CC BY 4.0 by the author.