How to advertise networks in BGP

Hi Rouzbeh,

  1. If no mask is specified, default mask is used, that is /8 in your example.
  2. When Rene said “exact mask has to be added in network command” meant that if we have a prefix in routing table (say 192.168.1.0/25), and we want this prefix to be injected in bgp with network command we should use
router bgp 1
network 192.168.1.0 255.255.255.128

in our config.
If we are going to use:

router bgp 1
network 192.168.1.0

, router will assume an implicit mask (255.255.255.0).
So 192.168.1.0/24 prefix will not enter bgp table because we do not have 192.168.1.0/24 in routing table. We have 192.168.1.0/25 but not 192.168.1.0/24.
Briefly, if we have 192.168.1.0/25 in r. table, we should use EXACT prefix (of course) and mask (!) in network statement
network 192.168.1.0 255.255.255.128
Hope it helps.
A.

1 Like