How to advertise networks in BGP

Hello Ajith

Let’s say you have the following topology:
image
Imagine that behind R1, you have the following prefixes:

172.16.1.0/24
172.16.2.0/24
172.16.3.0/24
172.16.4.0/24
172.16.5.0/24

You configure R1 as follows:

R1#show run | section router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 aggregate-address 172.16.0.0 255.255.0.0
 neighbor 192.168.12.2 remote-as 2
 no auto-summary 

Notice that instead of advertising each and every prefix, you use the aggregate-address command to indicate the summary you want to advertise.

However, because BGP will only advertise whatever already exists in the routing table, with an exact prefix length, R2 will not receive these routes. Remember, the routing table will only have the individual prefixes rather than the summary. To remedy this, you can create the following static route:

R1(config)#ip route 172.16.0.0 255.255.0.0 null 0

and replace the aggregate-address command in the BGP configuration with this one:

R1(config-router)#network 172.16.0.0 mask 255.255.0.0

This solution is detailed in the following lesson under the BGP Summarization section. You can take a look for more details:

I hope this has been helpful!

Laz