2

Here are the filtering methods:
1.filter-list
2.distribute-list/prefix-list
3.route-map

The Cisco documentation is contradictory and I have come across various posts that contradict each other:

I would like to test this myself but I can not figure out how to do it.

enter image description here

enter image description here

1

I think that the right way to do is to apply all the methods at the same time. and to use increasingly larger masks for the input route.

Each of the above methods has a prefix or ACL with stats that can show you the hits. So on the contrary instead of applying each method as Ron suggested above I would rather apply all the methods as indicated and change the network mask for let's say 1.1.1.1 from 24 to 16 to 8

filter-list --will permit 1.0.0.0/8 (make this route come from another AS and filter it by AS, deny updates from that AS)
prefix-list --will permit 1.1.0.0/16
route-map --will permit 1.1.1.0/24

and so on
So by changing the mask of the same route I should be able to test the above. Ron just described an elimination process but does not give a practical method to check the results

Update: I tested the above and it worked. Use debugging to see the updates. You will see messages indicating what exactly denied each route! no need for matrix testing as suggested below

 router bgp 200
 bgp log-neighbor-changes
 redistribute connected
 neighbor 10.10.10.1 remote-as 100
 neighbor 10.10.10.1 prefix-list /16 in
 neighbor 10.10.10.1 route-map /24 in
 neighbor 10.10.10.1 filter-list 100 in

and the prefix list and filter lists used to test the above

ip as-path access-list 100 deny _300_
ip as-path access-list 100 permit .*

ip prefix-list /16 seq 5 permit 1.1.0.0/16 le 24
!
ip prefix-list /24 seq 5 permit 1.1.1.0/24
!
ip prefix-list /8 seq 5 permit 1.0.0.0/8 le 24
!
route-map /16 permit 10
 match ip address prefix-list /16
!
route-map /24 permit 10
 match ip address prefix-list /24

Use redistribute connected and loopbacks on this topology:
R3---R1---R2
(AS300): R3's L0 is 1.0.0.0
(AS100): R1'2 L0 is 1.1.0.0 and L1 is 1.1.1.0
use 10.10.10.0 and 10.10.20.0 to interconnect the routers. They will be blocked by the filters

2
  • Do it however you want, but I described the proper test procedure. In the end, you will find that all of them work individually, and the end result is a full combination of all the methods. – Ron Maupin Aug 7 '16 at 18:31
  • Yeah I guess they will all work otherwise Cisco will be ashamed :-)) – MiniMe Aug 7 '16 at 18:40
0

Use the scientific method.

Create a filter type chart like this:

-------------------------
| X | A | B | C | D | E |
-------------------------
| A | X |   |   |   |   |
-------------------------
| B | X | X |   |   |   |
-------------------------
| C | X | X | X |   |   |
-------------------------
| D | X | X | X | X |   |
-------------------------
| E | X | X | X | X | X |
-------------------------
  1. Build a lab using BGP between two routers, and make sure it is working and sharing prefixes. That is your control. Save the configurations so that you can restore the control.
  2. Add one filter type (A), and observe the results.
  3. Add one more filter type (B), and observe the results. Note which appears to have precedence. Mark the chart with the results at the intersection of A and B.
  4. Restore your control configuration.
  5. Repeat Step 2 (filter type A).
  6. Repeat Step 3 with another filter type (C). Mark the chart with the results at the intersection of A and C.
  7. Restore your control configuration.
  8. Repeat Step 2 (filter type A).
  9. Repeat Step 3 with another filter type (D). Mark the chart with the results at the intersection of A and D.
  10. Restore your control configuration.
  11. Repeat Step 2 (filter type A).
  12. Repeat Step 3 with another filter type (E). Mark the chart with the results at the intersection of A and E.

At this point, you will know how filter type A relates to each of the other filter types.

Restore your control configuration.

Repeat Steps 2 and 3 for filter type B compared to type C.

Restore your control configuration.

Repeat Steps 2 and 3 for filter type B compared to type D.

Restore your control configuration.

Repeat Steps 2 and 3 for filter type B compared to type E.

Restore your control configuration.

Repeat Steps 2 and 3 for filter type C compared to type D.

Restore your control configuration.

Repeat Steps 2 and 3 for filter type C compared to type E.

Restore your control configuration.

Repeat Steps 2 and 3 for filter type D compared to type E.

At the end, you will know which filter types have precedence over the other filter types.


Don't confuse the Distribute List with the Prefix List or Route Map Redistribution.

7
  • Assume that I have three or four methods applied at the same time. How do you know which one actually kicks in ? Please allow me to underline "practical" in my initial post – MiniMe Aug 7 '16 at 18:07
  • They all do. What you want to find out is which happens before the others. – Ron Maupin Aug 7 '16 at 18:08
  • How do you do that? – MiniMe Aug 7 '16 at 18:08
  • I explained that in my answer. Test the way I outlined, and you will know the precedence. At the end, you will have a chart that shows which ones happen before others. – Ron Maupin Aug 7 '16 at 18:10
  • Filtering means the updated/routes will not make it to the RIB. Since the checkpoint is at the end of the chain how do you know which method (A,B,C or D) works and A,B,C and D are simultaneously applied? – MiniMe Aug 7 '16 at 18:13

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.