Skip to main content

BGP Path Attributes

BGP Path Attributes

BGP (Border Gateway protocol is a path vector routing protocol, meaning it uses path attributes to determine the best routing path. There are eight (8) attributes that BGP uses in the determination of that best path.

Mnemonic First Letter BGP Path Attribute
We W Weight
Love L Local_pref
Oranges O Originate
As A AS_path
Oranges O Origin type
Mean M MED (Multiple Exit Discriminator)
Pure P Paths
Refreshment R Router-ID

This is not inclusive of all 13 path attributes but this covers the majority of them. particularly those that we often see used in practice. 

WEIGHT
  • Cisco specific parameter
  • Local to the router
  • Preference: highest weight

image.png

LOCAL PREFERENCE (Local_pref)

This parameter often gets used for route manipulation.

  • Default value of 100
  • Preference: highest local_pref

image.png

ORIGINATE
  • How a path was sourced
  • Preference: local paths from network or redistribute commands are preferred versus local aggregates via aggregate-address command
AUTONOMOUS SYSTEM PATH (AS_path)
  • The number of autonomous systems in the path
  • Preference: shortest AS_path
  • It is the number of autonomous systems in the path NOT the number of routers in the path.

image.png

ORIGIN TYPE
  • Preference: lowest origin type
  1. IGP
  2. EGP
  3. ? Incomplete

image.png

MED (Multi-exit Discriminator)
  • Optional non-transitive attribute
  • A hint to external neighbors about the preferred path into an autonomous system (AS) that has multiple entry points
  • Preference: lowest MED

image.png

PATHS (eBGP vs iBGP)
  • Preference: eBGP over iBGP
eBGP iBGP
Administrative distance: 20 Administrative distance: 200
ROUTER-ID
  • Preference: route from the lowest router ID


Summary of the Attributes

Mnemonic First Letter BGP Path Attribute Preference
We W Weight Higher
Love L Local_pref Higher
Oranges O Originate Local vs Aggregate
As A AS_path Lower
Oranges O Origin type IGP vs EGP vs ?
Mean M MED Lower
Pure P Paths eBGP vs oBGP
Refreshment R Router-ID Lower

BGP Route Manipulation

image.png

Scenario: Make the preferred path for the 20.0.0.0 network go through another router

R4(config)#ip prefix-list PREF20 permit 20.0.0.0/24
R4(config)#route-map MAP20 permit 10
R4(config-route-map)#match ip address prefix-list PREF20
R4(config-route-map)#set ?

image.png

R4(config-route-map)#set weight 999
R4(config-route-map)#exit
R4(config)#route-map MAP20 permit 20
R4(config-route-map)#exit
R4(config)#router bgp 65004
R4(config-router)#neighbor 34.34.34.1 route-map MAP20 in
R4(config-router)#end
R4#clear ip bgp *

image.png

Summary of Route Manipulation Steps

Create a prefix list Router(config)#ip prefix-list [list name] permit [network IP]
Create a route map

Router(config)#route-map [map name] permit [line #]
Router(config-route-map)#match ip address prefix-list [list name]

Router(config-route-map)#set weight [value]

Apply the route map to BGP configuration Router(config-router)#neighbor [neighbor IP address] route-map [map name] [in/out]

BGP Transitive and Non-transitive Attributes

Transitive Attributes are those BGP attributes that are ALLOWED to be sent to other BGP peers.  Non-transitive attributes  are NOT allowed to be sent to other peers.

There are four categories of path attributes:

Well-known mandatory This attribute MUST exist in the BGP UPDATE. If this attribute is missing a NOTIFICATION error is generated and the session is closed. Must be recognized by all BGP routers and must be included in every update message. Routing information errors occur without this attribute.
Well-known discretionary Can be recognized by all BGP routers; can be included in every update message as needed.
Optional transitive Transitive attribute between ASs. A BGP router not supporting this attribute can still receive routes with this attribute and advertise them to other peers.
Optional non-transitive If a BGP router does not support this attribute, it will not advertise routes with this attribute.

 

BGP Path Attribute Category
Weight Cisco specific local to router
Local_pref Well-known discretionary
AS_path Well-known mandatory
Origin type Well-known mandatory
MED Optional non-transitive

Troubleshooting BGP