BGP Path Attributes Table – The Backbone of BGP Decisions | NetworkJourney [ CCNP ENTERPRISE ]

BGP Path Attributes Table – The Backbone of BGP Decisions | NetworkJourney [ CCNP ENTERPRISE ]_networkjourney

Back in my early networking days, I thought BGP worked like OSPF or EIGRP — throw in some networks, and magic happens. But as I dug deeper, I realized BGP is a policy-based routing protocol, not just metric-based. And at the heart of this policy engine lies something powerful: BGP Path Attributes.

In every CCNA, CCNP, or real-world enterprise routing scenario, understanding these attributes is crucial. They control how BGP makes decisions, resolves route conflicts, and applies traffic engineering. So today, let’s decode the BGP Path Attribute Table in the simplest, most hands-on way possible. Ready? Let’s go


Theory in Brief: What Are BGP Path Attributes?

In BGP, when multiple paths exist to reach the same destination, it doesn’t choose the “shortest path” like OSPF. Instead, BGP uses a path selection process, relying on various attributes that each route carries.

These Path Attributes are pieces of information associated with each BGP route. They define how a path is selected, advertised, and preferred. They’re divided into different types like:

  • Well-known mandatory
  • Well-known discretionary
  • Optional transitive
  • Optional non-transitive

Some of the most common and powerful attributes include Weight, Local Preference, AS-PATH, Origin, MED, Next-Hop, and Community. They allow for incredible flexibility in manipulating traffic—upstream and downstream.

The key point? The order of attribute evaluation matters. Cisco has a specific path selection logic (we’ll see that below), and by manipulating these attributes, you can influence BGP routing decisions without changing the actual topology.


BGP Path Attributes Summary

AttributeCategoryDefault BehaviorUsageLocal to RouterInfluences In/Out
WeightCisco proprietaryHigher is betterInfluences local route selectionYesInbound
Local PreferenceWell-known discretionaryHigher is betterSets preference within ASNoInbound
AS PathWell-known mandatoryShorter is betterIndicates AS traversalNoInbound
OriginWell-known mandatoryIGP < EGP < IncompleteIdentifies origin of routeNoInbound
MEDOptional non-transitiveLower is betterSuggests preferred inbound pathNoOutbound
Next-HopWell-known mandatoryMust be reachableIdentifies next hopNoInbound
CommunityOptional transitiveUsed for tagging routesPolicy control (route-maps)NoInbound/Outbound

Cisco BGP Best Path Selection Order

Cisco follows this path selection logic in the below order:

  1. Prefer Highest Weight
  2. Prefer Highest Local Preference
  3. Prefer Locally Originated Routes
  4. Prefer Shortest AS-PATH
  5. Prefer Lowest Origin Type (IGP < EGP < Incomplete)
  6. Prefer Lowest MED
  7. Prefer eBGP over iBGP
  8. Prefer Path with Lowest IGP metric to next-hop
  9. Prefer Oldest Path (for route stability)
  10. Prefer Lowest Router ID

Understanding this order is crucial for route manipulation and real-world troubleshooting.


Essential CLI Commands

TaskCommand
View BGP Routesshow ip bgp
View Path Attributesshow ip bgp <prefix>
Check Weight/Local Preference`show ip bgp
Set Weight (locally)neighbor <IP> weight <value>
Set Local PreferenceVia route-map and set local-preference
View AS-PATHshow ip bgp
Check Origin Codeshow ip bgp → i (IGP), e (EGP), ? (incomplete)
Set MEDroute-map with set metric <value>
View BGP Attributes in Detailshow ip bgp neighbors <IP> received-routes
Debug Path Selectiondebug ip bgp updates

Real-World Use Case – Controlling Inbound/Outbound Routing

ScenarioSolution Using Attributes
Prefer one ISP over another for outbound trafficSet higher local preference
Load balancing traffic across two ISPsUse AS-path prepending on one side
Control which ISP is preferred for incoming trafficSet lower MED towards preferred ISP
Prevent route learning from unknown sourceUse filtering via origin and AS-path
Tag routes for traffic engineeringUse communities and route-maps

EVE-NG LAB – BGP Attributes in Action

Lab Topology

  • R1 advertises 1.1.1.0/24
  • R3 receives routes via R2
  • We’ll use AS-PATH, Local Pref, and MED to manipulate routing

IP Scheme

RouterInterfaceIP AddressAS Number
R1G0/010.1.1.1/3065001
R2G0/010.1.1.2/3065002
R2G0/110.1.2.1/3065002
R3G0/010.1.2.2/3065003

Configuration Snippets

R1

router bgp 65001
network 1.1.1.0 mask 255.255.255.0
neighbor 10.1.1.2 remote-as 65002

R2

router bgp 65002
neighbor 10.1.1.1 remote-as 65001
neighbor 10.1.2.2 remote-as 65003

R3

router bgp 65003
neighbor 10.1.2.1 remote-as 65002

Manipulate AS Path (R2):

route-map PREPEND permit 10
set as-path prepend 65002 65002 65002

router bgp 65002
neighbor 10.1.2.2 route-map PREPEND out

Verification

R3# show ip bgp
R3# show ip bgp 1.1.1.0

Look for AS-path length, Local Preference, or MED as per configuration.


Troubleshooting Tips

IssueTip/Command
Unexpected route preferenceCheck Local Preference and AS-Path
Missing path attributesUse show ip bgp <prefix> for full view
Route not being selectedCheck BGP path selection order
Inbound traffic not respecting pathAdjust MED or AS-Path Prepending
Next-hop unreachableVerify with ping <next-hop> and routing table
Route-map not appliedCheck `show run
Community not workingUse ip bgp-community new-format
Attribute override not taking effectUse clear ip bgp <IP> soft

FAQ – BGP Path Attributes

FAQ 1: What are BGP path attributes and why are they important?

Answer:
BGP Path Attributes are metadata attached to routes that BGP uses to make decisions when multiple paths exist to the same destination. They define how BGP selects the best route based on a specific set of rules. Without path attributes, BGP wouldn’t have the logic to determine preferred routes in a multi-path environment. These attributes enable policy-based routing, allowing administrators to control traffic flow based on business needs rather than just shortest path.


FAQ 2: What are the types of BGP path attributes?

Answer:
BGP path attributes are categorized into four types:

  1. Well-known Mandatory: Must be recognized and included in every BGP update. (e.g., AS_PATH, ORIGIN, NEXT_HOP)
  2. Well-known Discretionary: Recognized by all BGP routers but not mandatory in all updates. (e.g., LOCAL_PREF)
  3. Optional Transitive: May not be supported by all routers but will be passed on to others. (e.g., COMMUNITY)
  4. Optional Non-Transitive: May not be passed beyond the neighbor. (e.g., MED)

These classifications help routers decide how to handle unknown or unsupported attributes.


FAQ 3: What is the purpose of the ‘Weight’ attribute in Cisco BGP?

Answer:
Weight is a Cisco-specific attribute used to influence local route preference. It is not advertised to other routers. The route with the highest weight is preferred for outbound traffic. It’s commonly used in enterprise networks where local routers need to prioritize one outbound path over another. The default weight is 0, but locally originated routes have a weight of 32768.


FAQ 4: How is Local Preference different from Weight?

Answer:
While both influence outbound routing decisions, the key differences are:

  • Weight is local to the router and not shared with any peers.
  • Local Preference is shared within the AS, making it useful for enterprise-wide traffic policies.
    Higher values are preferred for both. Local Preference is ideal when you want all routers in your AS to prefer a particular path.

FAQ 5: What is AS_PATH and how does it affect BGP routing?

Answer:
AS_PATH is a well-known mandatory attribute that lists the Autonomous Systems (AS) a route has traversed. BGP uses the shortest AS_PATH (least number of AS hops) as one of its key criteria for route selection. It’s also used for loop prevention—if a router sees its own AS number in the AS_PATH, it discards the route.


FAQ 6: What does the ORIGIN attribute signify in BGP?

Answer:
The ORIGIN attribute indicates how a route was introduced into BGP. It has three possible values:

  • IGP (i): Route originated via the network command.
  • EGP (e): From the now obsolete Exterior Gateway Protocol.
  • INCOMPLETE (?): Redistributed from another routing protocol (e.g., OSPF, static).

BGP prefers routes with IGP origin, then EGP, and finally Incomplete.


FAQ 7: How does the MED attribute influence routing decisions?

Answer:
Multi-Exit Discriminator (MED) is an optional non-transitive attribute that suggests to external neighbors which entry point into an AS is preferred. Lower MED values are more preferred. It only influences routing into your AS (inbound traffic), not outbound. MED is often used between two ISPs or two links between ASes to load balance or prefer one link over the other.


FAQ 8: What is the function of the NEXT_HOP attribute?

Answer:
NEXT_HOP is a well-known mandatory attribute that specifies the IP address of the next-hop router to reach a destination. For EBGP, the next-hop is usually the IP of the advertising router. For IBGP, the next-hop is not modified, which means internal routers must be able to reach external next-hops directly or via IGP. Incorrect next-hop settings can lead to blackholing or unreachable routes.


FAQ 9: What are BGP Communities and how are they used?

Answer:
Communities are optional transitive attributes used to tag routes with metadata. These tags don’t affect route selection directly but allow for policy-based filtering and manipulation using route-maps. For example, a route tagged with 100:10 could be accepted by one peer and blocked by another. Communities support prefix grouping, routing control, and automation in large-scale networks.


FAQ 10: What is the BGP Best Path Selection Order based on attributes?

Answer:
When multiple routes to the same prefix exist, BGP uses the following path selection logic (simplified):

  1. Highest Weight (Cisco-specific)
  2. Highest Local Preference
  3. Locally originated routes
  4. Shortest AS_PATH
  5. Lowest Origin Type (IGP < EGP < Incomplete)
  6. Lowest MED
  7. Prefer EBGP over IBGP
  8. Lowest IGP metric to next-hop
  9. Oldest route (for stability)
  10. Lowest Router ID

YouTube Link

Watch the Complete CCNP Enterprise: BGP Path Attributes Table Demo & Explanation on our channel:

Class 1 CCNP Enterprise Course and Lab Introduction | FULL COURSE 120+ HRS | Trained by Sagar Dhawan
Class 2 CCNP Enterprise: Packet Flow in Switch vs Router, Discussion on Control, Data and Management
Class 3 Discussion on Various Network Device Components
Class 4 Traditional Network Topology vs SD Access Simplified

Final Note

Understanding how to differentiate and implement BGP Path Attributes Table – The Backbone of BGP Decisions | NetworkJourney [ CCNP ENTERPRISE ] is critical for anyone pursuing CCNP Enterprise (ENCOR) certification or working in enterprise network roles. Use this guide in your practice labs, real-world projects, and interviews to show a solid grasp of architectural planning and CLI-level configuration skills.

If you found this article helpful and want to take your skills to the next level, I invite you to join my Instructor-Led Weekend Batch for:

CCNP Enterprise to CCIE Enterprise – Covering ENCOR, ENARSI, SD-WAN, and more!

Get hands-on labs, real-world projects, and industry-grade training that strengthens your Routing & Switching foundations while preparing you for advanced certifications and job roles.

Emailinfo@networkjourney.com
WhatsApp / Call: +91 97395 21088

Upskill now and future-proof your networking career!