You are here
Home > Topics > Routing

BGP Case Study: Impact of Auto-Summary on Redistribute and Network commands

It may be rare to find an IOS that has its BGP’s auto-summary command enabled by default, but I think it is very important to touch on this BGP quirky feature and its impact on how BGP injects routes from IP routing table to its BGP table and how it behaves differently when redistribution or network command is used.

Let kick things off by a really simple network topology. Two routers, in the same AS 10 with iBGP neighbor relationship established between the two. R1 has 5 subnets that it will advertise to R2. I will start with no auto-summary configured first, since this is the default in the recent IOS versions.

R1:
interface Loopback10
ip address 10.10.10.1 255.255.255.0

interface Loopback20
ip address 10.10.20.1 255.255.255.0

interface Loopback30
ip address 10.10.30.1 255.255.255.0

interface Loopback50
ip address 172.16.50.1 255.255.255.0

interface Loopback60
ip address 172.16.60.1 255.255.255.0

interface FastEthernet0/0
ip address 172.16.1.1 255.255.255.252
duplex auto
speed auto

router bgp 10
no synchronization
bgp log-neighbor-changes
neighbor 172.16.1.2 remote-as 10
no auto-summary
!

R2:
interface FastEthernet0/0
ip address 172.16.1.2 255.255.255.252
duplex auto
speed auto
!
router bgp 10
no synchronization
bgp log-neighbor-changes
neighbor 172.16.1.1 remote-as 10
no auto-summary
!

Obviously, I can see R1 subnets in its routing table, but not in its BGP table since I have not injected them yet. I will start with the “redistribute connected” command since it is less weird!

Now, I have added the following to R1:

router bgp 10
redistribute connected

The results above is somehow expected. All “connected” subnets were injected from the routing table to the BGP table and they were indeed advertised to R2:

Now, I will add the following:

R1
router bgp 10
 auto-summary

Let’s see how did the auto-summarization affect both routers.

For Redistribution:

A. Auto-Summary: inject/advertise the classful networks ONLY.
B. No Auto-Summary: inject/advertise ONLY the subnets (classful network’s components).

Now, I will add the following config lines for R1:

 router bgp 10
 no redistribute connected
 network 10.10.10.0 mask 255.255.255.0
 network 10.10.20.0 mask 255.255.255.0 
 network 10.10.30.0 mask 255.255.254.0 
 network 172.16.50.0 mask 255.255.255.0
 network 172.16.60.0 mask 255.255.255.0
 no auto-summary
!

As you can see from the show output above, there is one network missing which was not injected from the routing table to the BGP table. The reason behind that is that I had this command “network 10.10.30.0 mask 255.255.254.0” under the BGP process. Remember, to successfully inject a route using “network” command, the subnet in the network command must EXACTLY match the subnet/route in the routing table, which it does not in our example. This is a very important rule about BGP and should always be on your mind when troubleshooting. Also, as a related note, if an interface is down, it will not be present in the routing table, which means it will not be injected in the BGP table even if the network command was properly configured with a matching subnet. Another handy tip for troubleshooting.

So far the “network” command with no auto-summary behavior is very similar to the “redistribution” command. They both inject the subnets (classful network’s components) into the BGP table.

The only one remaining scenario is when using both “network” and auto-summary commands. Below, I added auto-summary to the BGP config and you might be surprised by the following show command output!

It’s exactly showing the BGP table as it was with no auto-summary command. Now is the quirky bit, I’m going to inject their classful networks and see how will the BGP table look like:

Now the BGP tables has both the classful networks and their components.


For Network command:

A. Auto-Summary: inject/advertise the subnets, as well as the classful networks (IF there is a matching network command) AND as long as AT LEAST one component is present in the routing table.
B. No Auto-Summary: inject/advertise ONLY the subnets (classful network’s components).

Point B is pretty obvious, but I will need to expand a bit on point A. The subnets will be advertised along with the classful networks if there is a matching “network” statement as explained and showed previously. One important point is the other condition which states that at least one component needs to be preset in the routing table..that is the ROUTING TABLE and not the BGP table. Below, I only kept 10.10.30.0/24 and removed all .10 networks.

R1:
no interface loopback10
no interface loopback20

bgp

10.10.30.0/24 is still in the routing table (note that I have corrected the network command for this subnet), so the BGP process injects the 10.0.0.0 in the BGP routing table. Now I am going to remove the last remaining .10 components:

R1:
no interface loopback30

bgp2

There are no .10 components in the routing table nor in the BGP table, even though I’m still advertising them with the network command under the BGP process. Since this condition has not met, BGP will no longer advertise the summary route since none of its component is present.

Note that you might need to clear the BGP process (clear ip bgp *) to refresh the BGP table. If you issue this command at work, I’m sure your manager will be very happy 🙂

Leave a Reply

Top