cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11203
Views
22
Helpful
7
Replies

Route Map vs. Prefix-List vs. Distribution List

kanishka321
Level 1
Level 1

Hello,

I am studying for my CCNP exam. I came across with network filtering. I know that you can use route map, prefix list, or distribute-list to filter networks. Is there any one of them has more advantages over the others? In other words, which technology is the best way to filter network routes? If you can explain it with an example, that will be great! Thank you.

7 Replies 7

milan.kulik
Level 10
Level 10

Hi,

I'd say:

BGP distribute-list syntax is quite confusing.

Prefix-list syntax is easier to understand and more flexible.

But using route-maps is much more flexible and powerful: you can match also other prefix attributes (not only IP addresses) and also to modify them when the route-map is applied!

Best regards,

Milan

Thank you for your response. Is it possible for you give me an example where route maps is more flexible and distribute-list and prefix list is not?

Hi,

here is an example where a route-map is matching AS_PATH and setting the Weight attribute finally:

http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#neighborsroutemaps

You can't do that with distribute-list nor prefix-list.

Here are more examples (the same document) what can be matched and set by the route-maps:

http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#matchandset

Best regards,

Milan

distribute and prefix list are often confused.  distribute list is only a command used to call an ACL or prefix-list to engineer what is allowed in and out the routing protocol.  route-map also utilized both acl and prefix-list and offers a lot more different match options.  So I personally believe it's best to use route-map over distribute list because of scalability and flexibility.

The original post clearly establishes the context for the question as network filtering and asks about 3 things as if they were equivalent things:  route map, prefix list, or distribute-list. And asks if one has advantages over the others. If we can clarify the differences in what they do then it should be easier to identify which one is best in a particular context. 

 

To start with the easiest one - a prefix list defines a list of network prefixes, specifying a network address, a bit mask, and potentially a range of prefix lengths. The prefix list can either permit or deny the specified set of network prefixes. But by itself a prefix list does not take any action. The prefix list must be called by something.

 

Which takes us to distribute lists. A distribute list is used in the configuration of a routing protocol and controls what prefixes might be learned or what prefixes might be advertised. The distribute list will call something to identify particular prefixes to be controlled, which might be a prefix list or might be an access list. 

 

A route map has multiple potential uses but this post is specifically about network filtering, so we will concentrate on that use. A route map (similar to a distribute list) may call something to identify particular prefixes to be controlled (could be prefix list or access list) but a route map does not necessarily require a match statement calling one of these. And a route map has the ability not only to be selective about what is advertised/or learned but also has the ability to change attributes of the prefixes being advertised/learned using the set command.

 

So these three commands do quite different things. Depending on what you want to accomplish it should be possible to choose the more effective tool.

HTH

Rick

Perfect answer.

Hello
I think you may be referring to bgp order of evaluation
Bgp does evaluate these depending on how you are using them either for ingress/egress filtering, route advertisements etc..

 

Egress evlaualtion
Distribute-list
Prefix-list
Filter-list
Route-map

Ingress evaluation
Route-map
Filter-list
Prefix-list
Distribute-list

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card