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. 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 220.127.116.11 /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 18.104.22.168/8:
R1(config)#router bgp 1 R1(config-router)#network 22.214.171.124
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 126.96.36.199 % 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: