BGP Auto-Summary

This topic is to discuss the following lesson:

Hi Rene,

So I am assuming [no auto-summary] is the default on BGP? Also, is there a command to see whether auto-sum is enabled or not. When I run [show run | section bgp] there is no mention of auto-sum.

Thanks,
Mario

Hi Mario,

No auto-summary is the default for BGP. It’s one of those commands that doesn’t show up in the running-config because it’s default.

I think you can see it with “show run all” though.

Rene

1 Like

Hi Rene,

I have followed the same config you have explained but it’s not working at all.
Refer to the below outputs.

IOU1#show run int lo0
Building configuration...

Current configuration : 61 bytes
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.0
end

IOU1#show run | s bgp
router bgp 1
 bgp log-neighbor-changes
 network 1.0.0.0
 neighbor 192.168.12.2 remote-as 2
 auto-summary
IOU1#show ip bgp summ
BGP router identifier 192.168.12.1, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.12.2    4            2      24      24        1    0    0 00:18:17        0
IOU1#show ip bgp
IOU1#show ip bgp 1.0.0.0
% Network not in table
IOU1#

Hello Krishendu

At first glance, i don’t see anything wrong with your configuration, but remember, there are two sides to the link. Check to see what configuration setup exists on the other BGP router. Also, try using some debugging commands such as debug ip bgp to see what is being exchanged between the routers.

I hope this has been helpful!

Laz

2 Likes

Hi,

If we can advertise exact network and subnet mask so whats is the need of auto-summary command?

What would be the reason to advertise network address without subnet mask? can you please give example of the network where have to advertise a network without subnet mask and then use auto-summary command?

Hello Card

BGP Auto-Summary is useful when you have many different subnets that you want to advertise. For example, let’s say you have 250 subnets of the form:

147.52.0.0/24
147.52.1.0/24
147.52.2.0/24
…
and
149.55.26.0/25
149.55.26.129/25
149.55.27.0/25
…
and
152.66.25.30/28
152.66.26.30/28
152.66.27.30/28

These are all discontiguous networks and if you want to advertise them all, you have to explicitly state each one with its subnet mask. That’s 250 network commands. You can use the auto-summary command to simplify configuration and reduce the number of network commands to the classful networks that contain all of the networks you want to advertise.

I hope this has been helpful!

Laz

2 Likes

Hello, with auto summary we advertised the network 1.0.0.0. I understand that with auto summary we don’t have to specify a subnet mask. Network 1.0.0.0 can now be seen on R2. But how does R2 now know where the Network-Part (Network-ID) starts at 1.0.0.0 without the knowing of the subnetmask?

thank you in advance

Hello Roberto

As stated in the lesson, when you don’t add the mask parameters, BGP will automatically advertise the classful network, or a subnet of that classful network if it exists in the routing table.

I hope this has been helpful!

Laz

1 Like

I think when Auto summary is enabled only classful boundaries are advertised, you have /24 subnet for Class A which could be the problem here.

Hello Sampath

I just tried labbing this up and used the same parameters and I was able to get the 1.0.0.0 network to appear in the routing table. It is true that auto-summary enables classful boundaries, but it is successfully applied whenever there is an interface that is configured with an IP address that is within that specific network boundary. In both the lesson, where we have 1.1.1.1/32 and @bapikrishnendu’s example where we have 1.1.1.1/24, both of these subnets fall within the 1.0.0.0/8 network that is used in the network command under the BGP configuration.

So the problem seems to be elsewhere. It’s a good idea to check the BGP configuration as I stated in my previous response to this post.

I hope this has been helpful!

Laz

2 Likes

Hi Rene,
Awesome lesson, but I have a question.
This command, R1(config-router)#network 1.0.0.0, why it’s advertised using mask 8, because belong to the class A?, I mean all networks that I put it will approximate to the type of CLASS?, A (/8),B(/16) or C(/24)?,

Another concern that I have, is what happens if we add another network like for example 1.1.0.0/16 , both the Loopback 0(1.1.1.1/32) and 1.1.0.0/16 it will advertised to other BGP routers as it CLASS that is A 1.0.0.0/8 right?, so to return traffic to the network 1.1.1.1 for example how it could be done?. I suppose R2 see this address belong to the entry 1.0.0.0/8 so reaches R1, and here use its routing table to send the packet right?

Hello Michael

The purpose of the lesson is to show the operation of the BGP auto-summary feature. If it is not enabled, then you must issue the network command with the appropriate subnet mask. In addition, that network/subnet mask combination must exist within the routing table in order for it to be advertised.

This is the most common configuration when using BGP, as it is most convenient to include subnet mask information in order to share more specific prefixes.

However, there are cases where you would want to force the BGP router to use classful subnet masks. That can be done by applying the BGP auto summary feature.

So to answer your question, only when this feature is applied will you get this behavior as you describe it in your post. The /8 mask is used in this particular case because the 1.0.0.0 network belongs to class A. If you used the network 150.0.0.0 command, the mask would be /16 because this is a class B address.

Yes, that is correct.

Traffic being sent to 1.1.1.1 would use the classful advertised route that has been shared with neighboring routers. It would indeed use the 1.0.0.0/8 entry since that is what has been advertised to neighboring BGP routers.

I hope this has been helpful!

Laz

1 Like

Thank you Laz, your answer was clear.

1 Like

Hello!

Is this auto-summary feature left disabled in the recent IOS versions?


obrázok

obrázok

obrázok

No output

obrázok


The output is there now.

Thank you in advance for your help.

Kind regards,
David

Hello David

The behavior that you describe in your post is normal. This is because the auto-summary feature is disabled by default on all Cisco IOS devices, as confirmed in this command reference. documentation.

Without the auto-summary feature, the prefix and mask used in the network command must match exactly a prefix with the same subnet mask within the routing table. Since your command network 11.0.0.0 has no mask keyword or argument, the classful mask of 255.0.0.0 is used. However, there is no 11.0.0.0/8 prefix in the routing table. (There is however a 11.0.0.0/24 prefix in the routing table).

Once you enable auto-summary, BGP will automatically advertise the classful network if you have the classful network or a subnet of this network in your routing table. In your case you have a subnet of this network, thus you see the output in the show ip bgp command.

I hope this has been helpful!

Laz

1 Like

Hello Rene,

I have a question. How was the router able to install the 1.0.0.0/8 route in its BGP table if it didnt originally have that network in the routing table?

I was under the impression that whenever we used the network command, that network we specify has to be in the routing table before it can be installed in the BGP table. In this case we only had the 1.1.1.1/32 directly connected route but not a 1.0.0.0/8 route so im a bit confused there.

How was the 1.0.0.0/8 network installed in the BGP table if it never had an entry for that network before using the auto summary command?

Is it because the directly connected route 1.1.1.1/32 is a subnet of the entire 1.0.0.0/8 range and since thats in the routing table it can start advertising the 1.0.0.0/8 network as long as we use the auto summary command?

Hello Paul

Indeed, BGP will advertise a prefix if the network command is used to specify that prefix to be advertised, and that prefix appears in the routing table with the exact subnet mask. That’s how the network command behaves by default.

However, when the auto-summary feature is enabled, it actually changes the way the network command operates. When auto-summary is enabled:

  • You can advertise a classful network without including the mask parameter in the command.
  • BGP will automatically advertise the classful network if you have the classful network or a subnet of this network in your routing table.

In the example in the lesson, both of these conditions were met. First, Rene issued the network 1.0.0.0 command. This command assumes the classful mask of 255.0.0.0 for this particular address. Secondly, there is a subnet of this classful network in the routing table, the 1.1.1.1/32 address assigned to the loopback interface. So this appears in the routing table as a directly connected network.

So both conditions are met, and thus the 1.0.0.0/8 network appears in the routing table.

I hope this has been helpful!

Laz

Hello Rene, Team,

What is the used case for auto-summary, isn’t it better to be more granular and know exactly what you are advertising. For me, it fills like you might advertise something you didn’t mean to with this command. Or I guess route-map will be used to control that?

Is this best practice? To enable auto-summary?

Kind regards,
Martin

Hello Martin

The auto-summary feature in BGP is used to automatically summarize routes at the classful network boundary, causing BGP to advertise the summarized routes of its own networks to its neighbors. The purpose of this command is to simplify the routing table by reducing the number of entries. It is useful in situations where you have very large routing tables and you want to reduce their size.

This of course has advantages and disadvantages, and you must weigh them carefully before using this command.

The advantages include a simplification of the routing table, reducing its size, improving efficiency, and simplifying management.

Disadvantages include a loss of granularity as you mention, and the potential for unintended route advertisements, especially in networks with discontiguous subnets.

So should you enable autosummary? Well, if you can avoid it, do so. Use it only if routing tables get too large and CPU and memory of BGP routers are being overly taxed.

Regarding the use of route maps, they are indeed a method to control and fine-tune what is advertised. Route maps can be used in conjunction with auto-summary to ensure that only the desired summaries are advertised, mitigating some of the risks.

I hope this has been helpful!

Laz

1 Like