cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1987
Views
0
Helpful
1
Replies

BGP route advertisement with AS prepend

CHARLES HEUPEL
Level 1
Level 1

See attached diagram.  I have 3 routers (A,B,C) that are running IBGP.  I have another router (D) that is connected to routers (B,C) and running EBGP.  I am trying to prepend the as path from router D to router C so that the preferred return path is through router B.  This works fine.  However, I don't understand why router C stops advertising the prefixes it learns from router D to router A and B once the as path prepends are applied.  I would have thought that router C would still advertise the prefixes it learns from router D but with a longer as-path.  However, once it learns the prefixes from router D with an extra as-path prepended, it stops advertising the prefixes altogether.  Can someone explain this to me?

Configs:

Rtr-A

router bgp 1

bgp log-neighbor-changes

neighbor 10.10.10.38 remote-as 1

neighbor 10.10.10.42 remote-as 1

!

address-family ipv4

  neighbor 10.1010.38 activate

  neighbor 10.10.10.38 next-hop-self

  neighbor 10.10.10.38 default-originate

  neighbor 10.10.10.42 activate

  neighbor 10.10.10.42 next-hop-self

  neighbor 10.10.10.42 default-originate

  no auto-summary

  no synchronization

exit-address-family

Rtr-B

router bgp 1
bgp log-neighbor-changes
neighbor 10.10.10.21 remote-as 1

neighbor 10.10.10.33 remote-as 2

neighbor 10.10.10.41 remote-as 1
!
address-family ipv4
  neighbor 10.10.10.21 activate
  neighbor 10.10.10.21 next-hop-self
  neighbor 10.10.10.33 activate
  neighbor 10.10.10.33 default-originate
  neighbor 10.10.10.41 activate
  neighbor 10.10.10.41 next-hop-self
  no auto-summary
  no synchronization
exit-address-family

Rtr-C

router bgp 1

bgp log-neighbor-changes

neighbor 10.10.10.22 remote-as 1

neighbor 10.10.10.29 remote-as 2

neighbor 10.10.10.37 remote-as 1

!

address-family ipv4

  neighbor 10.10.10.22 activate

  neighbor 10.10.10.22 next-hop-self

  neighbor 10.1010.29 activate

  neighbor 10.10.10.29 default-originate

  neighbor 10.10.10.37 activate

  neighbor 10.10.10.37 next-hop-self

  no auto-summary

  no synchronization

exit-address-family

Rtr-D

router bgp 2

bgp log-neighbor-changes

neighbor 69.8.160.30 remote-as 1

neighbor 69.8.160.34 remote-as 1

!

address-family ipv4

  neighbor 10.10.10.30 activate

  neighbor 10.10.10.30 route-map outbound out

  neighbor 10.10.10.34 activate

  neighbor 10.10.10.34 send-community both

  neighbor 10.10.10.34 route-map outbounnd out

  no auto-summary

  no synchronization

  network 10.1.1.0 mask 255.255.255.0

  network 10.1.2.0 mask 255.255.255.0

  exit-address-family

ip prefix-list prefixes seq 5 permit 10.1.1.0/24

ip prefix-list prefixes seq 10 permit 10.1.2.0/24

!

route-map outbound permit 10

match ip address prefix-list prefixes

set as-path prepend 2

1 Reply 1

Peter Paluch
Cisco Employee
Cisco Employee

Hi Charles,

There seems to be a small typo in your Router D configuration: towards the neighbor 10.10.10.34, you are using the route-map outbounnd with an extra "n" in its name.

However, what is probably happening here:

  1. B and C receive the same routes from D. On C, the routes have a longer AS_PATH list.
  2. B selects the best path route and advertises it to A and C.
  3. C has two options now: either a route with shorter AS_PATH list through B, or directly towards D with a longer AS_PATH list. In Cisco's BGP bestpath algorithm, the AS_PATH length is evaluated in the Step 4 (first three steps being highest weight, highest local preference and locally injected routes).
  4. C has thus selected an iBGP route through B towards the networks. Because these networks are learned via iBGP, C cannot advertise them to any other iBGP neighbor, hence the behavior you are observing.

One of the most confusing aspects in BGP is the fact that every BGP speaker announces only the best path towards a destination from its database. It keeps me confused all the time

Best regards,

Peter

Review Cisco Networking products for a $25 gift card