10-26-2017 06:05 AM - edited 03-08-2019 12:30 PM
Hi
I am looking to modify my current prefix list on a router that faces the MPLS. Currently my routing table show all the private and service provider routes. I just want to receive any private routes and a default route but not any of the service provider public routes.
I have come up with the following Inbound prefix list
ip prefix-list PL-TW-IN seq 10 permit 10.0.0.0/8 le 32
ip prefix-list PL-TW-IN seq 15 permit 172.16.0.0/12 le 32
ip prefix-list PL-TW-IN seq 20 permit 192.168.0.0/16 le 32
ip prefix-list PL-TW-IN seq 25 permit 0.0.0.0/0
ip prefix-list PL-TW-IN seq 30 deny 0.0.0.0/0 le 32
Will this allow all private addresses and the default route, but block anything else?
Solved! Go to Solution.
10-26-2017 06:48 AM
10-26-2017 06:48 AM
09-04-2020 02:12 AM
Hey, I know a bit old, but to make it more clear to people learning prefix-lists and route-maps:
To be even more precise, it sort of depends on how you use it:
ip prefix-list PL permit A ip prefix-list PL deny B route-map RM1 permit 10 match ip address prefix PL route-map RM1 deny 20 route-map RM2 deny 10 match ip address prefix PL route-map RM2 permit 20
Route-maps RM1 and RM2, obviously, do exactly the opposite. Which basically means the result depends on both prefix-list and route-map order and logic. Seems confusing, but it allows you to do lot of magic if properly used.
So in your case you'll achieve desired result only if used in a route-map like this:
route-map RM-TW-IN permit 10 match ip address prefix PL-TW-IN route-map RM1 deny 20
Jozef
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide