2

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.

2
  • What is the result of Show BGP?
    – Ron Trunk
    Jan 16, 2017 at 13:26
  • The Question was been updated
    – kockiren
    Jan 16, 2017 at 14:00

2 Answers 2

5

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
!
0

Your network statement is for a /24 or the classfull, your prefix-list only allows /28 and your local networks don't match. You need to align the masks.

try this out as example.

     network 128.16.16.0 mask 255.255.252.0

     ip prefix-list 1 seq 5 permit 128.16.16.16/22
1
  • The problem was that the network wasnt in the router bgp config, there was only the /22 network. Adding this /28 network let me advertise the route.
    – kockiren
    Jan 16, 2017 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.