In a previous lesson, I explained how the BGP network command works. When we enable auto-summary for BGP, the way the network command works changes slightly.
Normally when you advertise a network in BGP, you have to type in the exact network and subnet mask that you want to advertise or it won’t be placed in the BGP table.
With auto-summary enabled, you can advertise a classful network, and you don’t have to add the mask parameter. BGP will automatically advertise the classful network if you have the classful network or a subnet of this network in your routing table.
Using auto-summary has advantages and disadvantages. One major advantage is that the receiving router receives fewer prefixes. This helps with routers with CPU and/or memory constraints. The disadvantage is that you have a loss of detailed routing information. It’s possible that you will receive traffic for prefixes that you don’t have, but that match the advertised summary. Nowadays, we have powerful hardware so it’s best to avoid auto-summary. If you use it, you might want to consider using a route-map so that you only advertise to to specific routers.
Configuration
Let me give you an example to explain what I’m talking about. I’ll use these two routers:
These routers are configured for eBGP. There’s a loopback interface on R1 with network 1.1.1.1 /32. Here’s the configuration:
R1#show run | section bgp
router bgp 1
bgp log-neighbor-changes
neighbor 192.168.12.2 remote-as 2
R2#show run | section bgp
router bgp 2
bgp log-neighbor-changes
neighbor 192.168.12.1 remote-as 1
The configuration is straight-forward, we only configured eBGP, no networks have been advertised and auto-summary is disabled. Let’s see if we can advertise classful network 1.0.0.0/8:
R1(config)#router bgp 1
R1(config-router)#network 1.0.0.0
Note that I didn’t specify a subnet mask with the mask parameter. Take a look at the BGP table now:
R1#show ip bgp 1.0.0.0
% Network not in table
As expected there is nothing in the BGP table since we require the exact network and subnet mask. Let’s enable auto-summary now so you can see the difference:
R1(config)#router bgp 1
R1(config-router)#auto-summary
After enabling auto-summary things will change. Take a look at the BGP table of R1:
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
Hi Rene,
I have followed the same config you have explained but it’s not working at all.
... Continue reading in our forumRefer to the below outputs.
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
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?