BGP Route Aggregation / Summarization explained, configured, and some important details for exam day!

iBGP_15

I’d like to start off with a quick example of the output from when I was adjusting routers from the previous lab for this lab, by doing “no router bgp 123” on it and creating AS 15 on it, with a neigbor statement point at 172.12.15.5 and went to R5 to do the same:

*Apr 15 10:58:01.535: %BGP-3-NOTIFICATION: received from neighbor 172.12.15.1 active 2/2 (peer in wrong AS) 2 bytes 0005
R5(config)#
*Apr 15 10:58:01.535: %BGP_SESSION-5-ADJCHANGE: neighbor 172.12.15.1 IPv4 Unicast topology base removed from session  BGP Notification received
R5(config)#
*Apr 15 10:58:11.775: %BGP-3-NOTIFICATION: received from neighbor 172.12.15.1 active 2/2 (peer in wrong AS) 2 bytes 0005
R5(config)#
*Apr 15 10:58:11.775: %BGP_SESSION-5-ADJCHANGE: neighbor 172.12.15.1 IPv4 Unicast topology base removed from session  BGP Notification received
R5(config)#

This is because R5 is configured for its neighbor to be in AS 123 still, as soon as I hit “no router bgp 5” the message immediately stopped.

So just to note if this is seen in the exam, you will need to verify that the neighbor statements and AS numbers they are configured in are consistent on both sides, in this scenario it is because R5 is still running AS 5 so removing it entirely worked to stop the messages.

Anyways, enough about that output, just wanted to share the information for the sake of more knowledge.

Now I am not going to give examples of the process of breaking multiple routes down to binary, however there is a good lesson here on how to do it, but at its easiest you break all routes down to binary and find the last matching bits common to all masks and that will give you the network number while the remaining bits will give you the mask.

So to start off, I configure 4 loopback networks on R1 to summarize and confirm that BGP is seeing them on R5 as individual networks to start:

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int lo8
R1(config-if)#ip add 172.16.8.1 255.255.255.0
R1(config-if)#int lo9
R1(config-if)#ip add 172.16.9.1 255.255.255.0
R1(config-if)#int lo10
R1(config-if)#ip add 172.16.10.1 255.255.255.0
R1(config-if)#int lo11
R1(config-if)#ip add 172.16.11.1 255.255.255.0
R1(config-if)#
R1(config-if)#
*Mar 31 13:14:19.667: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback8, changed state to up
*Mar 31 13:14:19.815: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback9, changed state to up
*Mar 31 13:14:19.855: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback10, changed state to up
*Mar 31 13:14:19.891: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback11, changed state to up
R1(config-if)#router bgp 15
R1(config-router)#network 172.16.8.0 mask 255.255.255.0
R1(config-router)#network 172.16.9.0 mask 255.255.255.0
R1(config-router)#network 172.16.10.0 mask 255.255.255.0
R1(config-router)#network 172.16.11.0 mask 255.255.255.0
R1(config-router)#
ASR#2
[Resuming connection 2 to r5 … ]

R5#sh ip bgp
BGP table version is 5, local router ID is 5.5.5.5
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
*>i172.16.8.0/24    172.12.15.1              0    100      0 i
*>i172.16.9.0/24    172.12.15.1              0    100      0 i
*>i172.16.10.0/24   172.12.15.1              0    100      0 i
*>i172.16.11.0/24   172.12.15.1              0    100      0 i
R5#

So when summarizing this down to a single route, you can immediately eliminate the octets that match, and write out the non-matching octet  (third) to get your summary route:

00001000 = 8
00001001 = 9
00001010 = 10
00001011 = 11

The bits stop matching on the 6th bit of the third octet, so the network is 172.16.8.0 /22, so I guess I did give sort of an example here. However it’s important to learn it ends at the last matching bit, and if the last common bit is a 0, you need to find the last matching 1’s and the will be the network number however the mask will extend out as far as the 0’s match.

That is a very important concept to pay close attention to while summarizing routes, so if your not 100% clear on that, I highly recommend visiting the above link.

Once again as this is important, you can skip over matching octets when making summary routes to save time, as all those octets bits will all match if they are the same number.

Now, onto BGP getting involved with Route Aggregation:

R1(config)#router bgp 15
R1(config-router)#?
Router configuration commands:
  address-family       Enter Address Family command mode
  aggregate-address    Configure BGP aggregate entries
  auto-summary         Enable automatic network number summarization
  bgp                  BGP specific commands
  default              Set a command to its defaults
  default-information  Control distribution of default information

I’ll spare the entire modifier list, but as can be seen, the command is right at the top highlighted in red for clarity sake in BGP router configuration mode with no preamble command like “neighbor” or “bgp” for it.

So I’ll step through the configuration of this with a ? after each step to see the options:

R1(config-router)#aggregate-address ?
  A.B.C.D  Aggregate address

R1(config-router)#aggregate-address 172.16.8.0 ?
  A.B.C.D  Aggregate mask

R1(config-router)#aggregate-address 172.16.8.0 255.255.252.0 ?
  advertise-map  Set condition to advertise attribute
  as-set         Generate AS set path information
  attribute-map  Set attributes of aggregate
  nlri           Nlri aggregate applies to
  route-map      Set parameters of aggregate
  summary-only   Filter more specific routes from updates
  suppress-map   Conditionally filter more specific routes from updates
  <cr>

R1(config-router)#aggregate-address 172.16.8.0 255.255.252.0
R1(config-router)#

I believe most of the the modifiers after the mask are beyond the scope of the CCNP course, so I’ll take the <cr> here, and see if we do need any of those modifiers.

So lets see if R5 looks any different now:

R5#sh ip bgp
BGP table version is 6, local router ID is 5.5.5.5
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
*>i172.16.8.0/24    172.12.15.1              0    100      0 i
*>i172.16.8.0/22    172.12.15.1              0    100      0 i
*>i172.16.9.0/24    172.12.15.1              0    100      0 i
*>i172.16.10.0/24   172.12.15.1              0    100      0 i
*>i172.16.11.0/24   172.12.15.1              0    100      0 i
R5#

Hmm. So we still have all our individual networks listed with the addition of the aggregate route as well now, which I don’t believe should be the behavior so I will try a clear here:

R5#clear ip bgp * soft in
R5#sh ip bgp
BGP table version is 6, local router ID is 5.5.5.5
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
*>i172.16.8.0/24    172.12.15.1              0    100      0 i
*>i172.16.8.0/22    172.12.15.1              0    100      0 i
*>i172.16.9.0/24    172.12.15.1              0    100      0 i
*>i172.16.10.0/24   172.12.15.1              0    100      0 i
*>i172.16.11.0/24   172.12.15.1              0    100      0 i
R5#

So I consulted the training material, and this is actually a default behavior of BGP when using the aggregate command with no options, you will advertise the aggregate route in addition to all the individual routes.

So to only advertise the aggregate route, we are going to need one of those modifiers in the after the aggregate address / mask in the aggregate-address command:

R1(config-router)#exit
R1(config)#router bgp 15
R1(config-router)#no aggregate-address 172.16.8.0 255.255.252.0
R1(config-router)#aggregate-address 172.16.8.0 255.255.252.0 ?
  advertise-map  Set condition to advertise attribute
  as-set         Generate AS set path information
  attribute-map  Set attributes of aggregate
  nlri           Nlri aggregate applies to
  route-map      Set parameters of aggregate
  summary-only   Filter more specific routes from updates
  suppress-map   Conditionally filter more specific routes from updates
  <cr>

R1(config-router)#aggregate-address 172.16.8.0 255.255.252.0 summary-only
R1(config-router)#

We are using summary-only here, as this will filter ALL ROUTES that are part of an aggregate route, however if you want to filter specific routes rather than all of them in the aggregate address then you could use suppress-map.

I won’t be going over suppress-map, but worth mentioning that is used to filter some routes, summary-only will filter all routes that fit into the summary network.

Now to verify on R5:

R5#sh ip bgp
BGP table version is 12, local router ID is 5.5.5.5
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
*>i172.16.8.0/22    172.12.15.1              0    100      0 i
R5#

Didn’t need to clear ip bgp for this to turn into an aggregate route only, so it does get advertised with an update to the neighbor, whereas we saw that changing routing behaviors like “next-hop-self” didn’t trigger an update so the “clear ip bgp * soft in/out” command needed to be used to change the tables up.

And that is it for summary routes in BGP, next up I don’t believe I will need a lab for, but it will be a LOT of Theory / Fundamentals of Synchornization / Route Reflectors / Full Meshes / Lack of Full Meshes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s