In order to reduce the amount of routing information within the routing table, routing summarization is used.
Cisco IOS provides 3 types of BGP summarization:
- Aggregate Address - BGP is configured to advertise an aggregate network via the
- Manual - A summarized network is added to RIB via a null route, the network is then advertised via BGP using the
- Auto-Summarization - If the RIB contains a network that is part of a classful network then advertise the classful network.
Let us look at the first way to create a summary route for a group of networks. This can be achieved via the
aggregate-address command. Below shows an example of summarizing the networks:
router bgp 64520 network 172.29.10.0 mask 255.255.255.0 network 172.29.20.0 mask 255.255.255.0 network 172.29.30.0 mask 255.255.255.0 aggregate-address 172.29.0.0 255.255.224.0 summary-only
Once configured, you can then see the routes summarized by looking at the BGP table, using the status code
s>. As shown below:
r1#show ip bgp BGP table version is 36, local router ID is 100.100.100.100 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path *> 172.29.0.0/19 0.0.0.0 32768 i s> 172.29.10.0/24 0.0.0.0 0 32768 i s> 172.29.20.0/24 0.0.0.0 0 32768 i s> 172.29.30.0/24 0.0.0.0 0 32768 i
Manual summarization works by simply adding a static null route for the summarized network so that it is present within the RIB. This summarized network can then be adding to BGP via the
When traffic comes into the router, the router will select the more precise route, ensuring that the null route is not hit.
ip route 172.29.0.0 255.255.224.0 null0 router bgp 64520 network 172.29.0.0 mask 255.255.224.0
For example, let's say we have 172.29.10.0/24 through to 172.29.20.0/24 locally configured. Based on this we want to advertise a summarized route of
172.29.0.0/19 . However as we do not have this network within our RIB, when we add the network to BGP, it is not added to the BGP table and in turn not advertised.
Even though Cisco disables auto-summarization by default (shown below), it is worth mentioning how the command works.
router bgp 64520 no auto-summary
In short, when auto-summary is enabled BGP will automatically advertise the classful network, if you have the classful network or a subnet of this network in your routing table.
For example, let's say I add
network 172.29.0.0 to BGP (with
no auto-summary enabled). Unless I have the classful network of 172.29.0.0/16 in the RIB it will not be advertised. However with
auto-summary enabled, the fact that I have 172.29.10.0/24 in the RIB, the network 172.29.0.0/16 will be advertised.