3

the peering between our router and the other peer already established, and we are trying to add new prefix route: 192.168.0.0/24

Failing command

ip prefix-list PREFIX-FROM-A seq 15 permit 192.168.0.0/24

Working command

ip prefix-list PREFIX-FROM-A seq 15 permit 192.168.0.0/24 le 32

Working end result:

enter image description here

Question:

Does both ends prefix announcement length need to be matched for routes being able to exchange properly? 

  • 2
    The problem seems to be that the 192.168.0.0/24 prefix is not advertised so permitting it does nothing. It seems that the addresses in that network are being advertised as individual host prefixes, which is why your second works. You need to find out why all those addresses are being advertised individually. Remember that you cannot simply make up prefixes to advertise, it only advertises a prefix that is already in the routing table. The exception is to advertise using an aggregate, rather than a network statement. – Ron Maupin Nov 10 at 0:45
  • @RonMaupin so that implying if I am not using aggregate routes, both ends has to match the prefix announcement, correct? – Thomas G. Lau Nov 10 at 0:55
  • No, what I am saying is that the end advertising the prefix will only advertise what is in its routing table, other than using aggregates. Your first example is looking for a specific prefix that is not being advertised. We do not have the full BGP table, but it appears that one end is advertising only /32 host prefixes in your desired range. – Ron Maupin Nov 10 at 1:03
6

BGP prefix lists evaluate an exact match when not using le or ge statements on the end. For example, when your prefix list includes only ip prefix-list PREFIX-FROM-A seq 15 permit 192.168.0.0/24, your neighbour MUST be sending that prefix as an exact /24 to be accepted.

When appending le <cidr> to the end of a prefix list term, this tells our router to evaluate the prefix by matching up to <cidr> as long as its within the prefix.

For example, using your statement from the original post: ip prefix-list PREFIX-FROM-A seq 15 permit 192.168.0.0/24 le 32, this would allow anything within that /24 with the CIDR of the prefix being anywhere from /24 through to /32. Here are some further examples that would be accepted when using le 32 on the end of your prefix list term:

  • 192.168.0.1/32 - ACCEPTED
  • 192.168.0.0/24 - ACCEPTED
  • 192.168.0.0/23 - REJECTED
  • 192.168.0.128/25 - ACCEPTED
| improve this answer | |
  • if I just want to make sure routes is received from my side, is it recommended to use le 32 to accept any combination? – Thomas G. Lau Nov 11 at 6:10
  • @ThomasG.Lau, In my opinion, your prefix list should be as specific as you can get it. BGP is a dangerous protocol by nature therefor nothing should be left to chance. Ideally in your scenario, AS23 should be aggregating those prefixes into a /24, or even something more specific like a /25. Remember, Routes in the RIB use memory. If you're able to aggregate a route then you should. – ditrapanij Nov 11 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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