4

I have a BGP session where the other participant is advertising the default route in addition to a number of small prefixes.

I want to filter out the default, but accept those other prefixes.

I've tried to use:

ip prefix-list no-default-route seq 5 deny 0.0.0.0/0

In combination with:

neighbor 10.4.1.1 prefix-list no-default-route in

But that ends up filtering all of the smaller prefix routes as well.

Is there a way I can filter out the default, but accept all other prefixes?

  • 2
    Remember, prefix-lists (just like access-lists) have an implicit deny statement at the end. You're denying 0.0.0.0/0 as well as everything else. – Ryan Foley Sep 9 '14 at 9:14
  • Thanks for pointing that out -- it didn't dawn on me that there is an implicit deny. – Elliot B. Sep 9 '14 at 18:34
7

You need to add a statement to explicitly allow those prefixes after denying the default-route, so the final prefix-list becomes:

ip prefix-list no-default-route seq 5 deny 0.0.0.0/0
ip prefix-list no-default-route seq 10 permit 0.0.0.0/0 le 32
| improve this answer | |
0

The accepted answer is correct. Another way of writing the same thing, with just one rule, would be:

ip prefix-list no-default-route seq 5 permit 0.0.0.0/0 ge 1
| improve this answer | |

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.