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
Table of Contents
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
Attribute | Category | Default Behavior | Usage | Local to Router | Influences In/Out |
---|---|---|---|---|---|
Weight | Cisco proprietary | Higher is better | Influences local route selection | Yes | Inbound |
Local Preference | Well-known discretionary | Higher is better | Sets preference within AS | No | Inbound |
AS Path | Well-known mandatory | Shorter is better | Indicates AS traversal | No | Inbound |
Origin | Well-known mandatory | IGP < EGP < Incomplete | Identifies origin of route | No | Inbound |
MED | Optional non-transitive | Lower is better | Suggests preferred inbound path | No | Outbound |
Next-Hop | Well-known mandatory | Must be reachable | Identifies next hop | No | Inbound |
Community | Optional transitive | Used for tagging routes | Policy control (route-maps) | No | Inbound/Outbound |
Cisco BGP Best Path Selection Order
Cisco follows this path selection logic in the below order:
- Prefer Highest Weight
- Prefer Highest Local Preference
- Prefer Locally Originated Routes
- Prefer Shortest AS-PATH
- Prefer Lowest Origin Type (IGP < EGP < Incomplete)
- Prefer Lowest MED
- Prefer eBGP over iBGP
- Prefer Path with Lowest IGP metric to next-hop
- Prefer Oldest Path (for route stability)
- Prefer Lowest Router ID
Understanding this order is crucial for route manipulation and real-world troubleshooting.
Essential CLI Commands
Task | Command |
---|---|
View BGP Routes | show ip bgp |
View Path Attributes | show ip bgp <prefix> |
Check Weight/Local Preference | `show ip bgp |
Set Weight (locally) | neighbor <IP> weight <value> |
Set Local Preference | Via route-map and set local-preference |
View AS-PATH | show ip bgp |
Check Origin Code | show ip bgp → i (IGP), e (EGP), ? (incomplete) |
Set MED | route-map with set metric <value> |
View BGP Attributes in Detail | show ip bgp neighbors <IP> received-routes |
Debug Path Selection | debug ip bgp updates |
Real-World Use Case – Controlling Inbound/Outbound Routing
Scenario | Solution Using Attributes |
---|---|
Prefer one ISP over another for outbound traffic | Set higher local preference |
Load balancing traffic across two ISPs | Use AS-path prepending on one side |
Control which ISP is preferred for incoming traffic | Set lower MED towards preferred ISP |
Prevent route learning from unknown source | Use filtering via origin and AS-path |
Tag routes for traffic engineering | Use 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
Router | Interface | IP Address | AS Number |
---|---|---|---|
R1 | G0/0 | 10.1.1.1/30 | 65001 |
R2 | G0/0 | 10.1.1.2/30 | 65002 |
R2 | G0/1 | 10.1.2.1/30 | 65002 |
R3 | G0/0 | 10.1.2.2/30 | 65003 |
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
Issue | Tip/Command |
---|---|
Unexpected route preference | Check Local Preference and AS-Path |
Missing path attributes | Use show ip bgp <prefix> for full view |
Route not being selected | Check BGP path selection order |
Inbound traffic not respecting path | Adjust MED or AS-Path Prepending |
Next-hop unreachable | Verify with ping <next-hop> and routing table |
Route-map not applied | Check `show run |
Community not working | Use ip bgp-community new-format |
Attribute override not taking effect | Use 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:
- Well-known Mandatory: Must be recognized and included in every BGP update. (e.g., AS_PATH, ORIGIN, NEXT_HOP)
- Well-known Discretionary: Recognized by all BGP routers but not mandatory in all updates. (e.g., LOCAL_PREF)
- Optional Transitive: May not be supported by all routers but will be passed on to others. (e.g., COMMUNITY)
- 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):
- Highest Weight (Cisco-specific)
- Highest Local Preference
- Locally originated routes
- Shortest AS_PATH
- Lowest Origin Type (IGP < EGP < Incomplete)
- Lowest MED
- Prefer EBGP over IBGP
- Lowest IGP metric to next-hop
- Oldest route (for stability)
- Lowest Router ID
YouTube Link
Watch the Complete CCNP Enterprise: BGP Path Attributes Table Demo & Explanation on our channel:
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.
Email: info@networkjourney.com
WhatsApp / Call: +91 97395 21088
Upskill now and future-proof your networking career!