Advertisement of route into BGP: network / redistribution / aggregation

June 1, 2010 at 6:54 am | Posted in Blogroll | Leave a comment

If a prefix originates into BGP via 3 different methods: network/redistribution/aggregate, then below is the order of preference. The highest preference will be installed into the BGP table.

  1. Network statement with static route
  2. Redistribution of static route
  3. Aggregation

 Example below demonstrates the preferences.

 

R1#srsr
router bgp 13
 no synchronization
 bgp log-neighbor-changes
 network 1.1.0.0 mask 255.255.0.0
 network 1.1.1.1 mask 255.255.255.255
 aggregate-address 1.1.0.0 255.255.0.0
 redistribute static
 neighbor 13.0.0.3 remote-as 13
 no auto-summary

R3#srsr
router bgp 13
 no synchronization
 bgp log-neighbor-changes
 neighbor 13.0.0.1 remote-as 13

Without static or IGP route for 1.1.0.0/16, then the only way 
router originates 1.1.0.0/16 is via Aggregation

R3#sh ip bgp 1.1.0.0/16
BGP routing table entry for 1.1.0.0/16, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Not advertised to any peer
  Local, (aggregated by 13 13.0.0.1)
    13.0.0.1 from 13.0.0.1 (13.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, internal, atomic-aggregate, best

R1(config)#ip route 1.1.0.0 255.255.0.0 Null0

1.1.0.0/16 leant via all three ways (network, redistribution, aggregate), 
best is via Network Statement

R3#sh ip bgp 1.1.0.0/16
BGP routing table entry for 1.1.0.0/16, version 8
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  Local
    13.0.0.1 from 13.0.0.1 (13.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best

R1(config)#router bgp 13
R1(config-router)#no  network 1.1.0.0 mask 255.255.0.0

1.1.0.0/16 is advertised into BGP via 
both redistribution of static & aggregation, 
then redistribution take precedence.

R3#sh ip bgp 1.1.0.0/16
BGP routing table entry for 1.1.0.0/16, version 9
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  Local
    13.0.0.1 from 13.0.0.1 (13.0.0.1)
      Origin incomplete, metric 0, localpref 100, valid, internal, best

R1(config-router)#no ip route 1.1.0.0 255.255.0.0 Null0

Static is removed, then only ways 1.1.0.0/16 
advertised into BGP is via aggregation

R3#sh ip bgp 1.1.0.0/16
BGP routing table entry for 1.1.0.0/16, version 10
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  Local, (aggregated by 13 13.0.0.1)
    13.0.0.1 from 13.0.0.1 (13.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, internal, atomic-aggregate, best
Advertisements

Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: