26/09/2017
BGP Path Attributes
BGP Path Attributes
“We Love Oranges AS Oranges Mean Pure Refreshment”
Path | Description |
---|---|
W | Weight (highest) |
L | Local_pref (higest) |
O | Originate (Local) |
AS | AS_PATH (shortest) |
O | ORIGIN code ( igp > egp > incomplete) |
M | MED (lowest) |
P | Paths ( External > Internal) |
R | RID (Lowest) |
R1#sh ip bgp 40.40.40.0 *Mar 1 00:17:21.323: %SYS-5-CONFIG_I: Configured from console by console R1#sh ip bgp 40.40.40.0 BGP routing table entry for 40.40.40.0/24, version 4 Paths: (2 available, best #1, table Default-IP-Routing-Table) Advertised to update-groups: 1 30 3.3.3.2 from 3.3.3.2 (3.3.3.2) Origin IGP, metric 0, localpref 100, valid, external, best 20 2.2.2.2 from 2.2.2.2 (20.20.20.1) Origin IGP, metric 0, localpref 100, valid, external R1#sh ip bgp BGP table version is 4, local router ID is 3.3.3.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 20.20.20.0/24 2.2.2.2 0 0 20 i *> 30.30.30.0/24 3.3.3.2 0 0 30 i *> 40.40.40.0/24 3.3.3.2 0 0 30 i * 2.2.2.2 0 0 20 i
- BGP uses different path attributes to calculate the best path for a route.
- Each path attribute defines something different about the path.
- The most common BGP path attributes are:
- Weight
- Local Preference
- AS_PATH
- Origin
- Multi Exit Discriminator
Weight
- Higher is preferred.
- Can be used to influcence outbound traffic.
- Cisco proprietary feature (not exactly a path attribute).
- Locally significant to a single router not advertised to any other BGP neighbors.
- Default weight is 0.
- Range from 0 to 65535 ( 2^16-1 )
- With a route-map use the set weight
R1(config)#router bgp 10 R1(config-router)#neighbor 2.2.2.2 weight 100 R1#sh ip bgp BGP table version is 4, local router ID is 3.3.3.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 20.20.20.0/24 2.2.2.2 0 100 20 i *> 30.30.30.0/24 3.3.3.2 0 0 30 i * 40.40.40.0/24 3.3.3.2 0 0 30 i *> 2.2.2.2 0 100 20 i
ip prefix-list 20 seq 5 permit 40.40.40.0/24 le 32 route-map 30 permit 10 match ip address prefix-list 20 set weight 150 ! route-map 30 permit 20 R1#sh ip bgp BGP table version is 4, local router ID is 3.3.3.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 20.20.20.0/24 2.2.2.2 0 100 20 i *> 30.30.30.0/24 3.3.3.2 0 0 30 i *> 40.40.40.0/24 3.3.3.2 0 150 30 i * 2.2.2.2 0 100 20 i
Local_Pref
- Can be used to influcence outbound traffic.
- This is a BGP path attribute.
- Defines the best exitpoint from the AS to a prefix.
- local_pref is advertised to all iBGP neighbors, but not to eBGP neighbors ( non transitive ).
- Higher value is preferred
- Range is 0 – 4,294,967, 295 ( 2^32-1)
- Default value is 100
- Use a route-map with set local-preference
access-list 1 permit 30.30.30.0 0.0.0.255 route-map 30 permit 10 match ip address prefix-list 20 set weight 150 ! route-map 30 permit 20 match ip address 1 set local-preference 120 R1# sh ip bgp best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 20.20.20.0/24 2.2.2.2 0 100 20 i *> 30.30.30.0/24 3.3.3.2 0 120 0 30 i *> 40.40.40.0/24 3.3.3.2 0 150 30 i * 2.2.2.2 0 100 20 i
AS_Path Length
- Can be used to influcence inbound and outbound traffic
- AS_PATH is a BGP attribute
- Default PA to determine best path when no other PAs are modified
- Shortest AS_PATH is preferred
- With AS prepending you can create a longer path.
Multi Exit Distriminator
- Med is a BGP Path attribute.
- It can be modified to influence the inbound traffic.
- With dual links the incoming traffic can be influenced.
- It’s not advertised beyond the neighboring AS
- Range is 0 – 4,294,967, 295 ( 2^32-1)
- Default zero