Cisco – Why there is no advertised route to a neighbor on Cisco ISR

bgpciscocisco-iosrouting

With the following config I try to advertise a network to neighbor but the show command only list 0 prefixes to this neighbor.

router bgp 2
 bgp log-neighbor-changes
 neighbor 128.16.16.34 remote-as 1
 !
 address-family ipv4
  network 128.16.16.0
  network 128.16.16.0 mask 255.255.255.0
  neighbor 128.16.16.34 activate
  neighbor 128.16.16.34 route-map red out
 exit-address-family
!
ip route 128.16.16.0 255.255.255.0 Null0 200
!
ip prefix-list 1 seq 5 permit 128.16.16.16/28
!
route-map red permit 10
 match ip address prefix-list 1
!

On one interface there is the network 128.16.16.32/30 connected (BGP neighbor) and on a second interface there is the network 128.16.16.16/28 connected, this second network should be advertised to the neighbor.

This is the routing table:

#sh ip route | inc 128.16.16.
S        128.16.16.0/22 is directly connected, Null0
C        128.16.16.16/28 is directly connected, GigabitEthernet0/0/0
L        128.16.16.18/32 is directly connected, GigabitEthernet0/0/0
C        128.16.16.32/30 is directly connected, GigabitEthernet0/0/1
L        128.16.16.33/32 is directly connected, GigabitEthernet0/0/1

This is the output of sh bgp command:

#sh bgp | inc 128.16.16.
BGP table version is 39103822, local router ID is 128.16.16.34
 *>  128.16.16.0/22  0.0.0.0                  0         32768 i
                       128.16.16.34                          0 1 i
                       128.16.16.34                          0 1 i

And this one the show advertised route command:

#sh ip bgp neighbors 128.16.16.34 advertised-routes 

Total number of prefixes 0 

If I delete the neighbor 128.16.16.34 route-map red out command then the sh advertised route command contains all routes. How can I debug why the route don't advertise the route from route map.

Best Answer

You don't have a network statement for the network you are trying to advertise.

Add the network in you BGP config will solve this issue:

router bgp 2
 !
 address-family ipv4
  network 128.16.16.16 mask 255.255.255.240
 exit-address-family
!