Saturday, December 14, 2013

[mini] BGP Auto-Summary

I recently got a task on a practice lab that was obviously regarding BGP auto summary.  I'm well-practiced in BGP on production systems, but who the heck uses auto-summary any longer?  It then occurred to me that I'd never even turned it on.

My first attempt was to:

int lo5
  ip address 5.5.5.5 255.255.255.0

router bgp 100
  auto-summary
  network 5.5.5.0 mask 255.255.255.0

I peered it up with another router, and expected to see "5.0.0.0/8" in the BGP table of the other router.

No such luck, I ended up with 5.5.5.0/24.

After some googling, I found two methods to make this work:

int lo5
  ip address 5.5.5.5 255.255.255.0

router bgp 100
  auto-summary
  network 5.0.0.0

That will produce 5.0.0.0 in both the local BGP table and anyone it peers to.

You can also:

int lo5
  ip address 5.5.5.5 255.255.255.0

router bgp 100
  auto-summary
  redistribute connected

That will also get you 5.0.0.0 in both the local BGP table and anyone it peers to.

Of interesting note, if you:

int lo5
  ip address 5.5.5.5 255.255.255.0

int lo6
  ip address 5.5.6.6 255.255.255.0

router bgp 100
  auto-summary
  network 5.5.0.0 mask 255.255.0.0

That will also produce 5.0.0.0/8.

Not a complex topic, but it works differently than the way IGPs do, and I thought it was worth mentioning.

Happy studying!

Jeff

1 comment:

  1. I guess, the auto-summarization happens when the "network" statement doesn't exactly match the interface you have.
    In the first example you had 5.5.5/24 loopback and 5.5.5/24 network statement. That`s the exact match, no summarization needed.

    ReplyDelete