# Filter list vs. Distribute lists

**URL:** <https://forum.networklessons.com/t/filter-list-vs-distribute-lists/757>\
**Category:** IP Routing\
**Created:** [November 7, 2016, 9:11pm UTC](https://forum.networklessons.com/t/filter-list-vs-distribute-lists/757 "2016-11-07T21:11:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_sheldon\_sharpe](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@mr\_sheldon\_sharpe](https://forum.networklessons.com/u/mr_sheldon_sharpe)\
**Post date:** [November 7, 2016, 9:11pm UTC](https://forum.networklessons.com/t/filter-list-vs-distribute-lists/757/1 "2016-11-07T21:11:11Z")

</div>

Can access-lists and prefix lists be used interchangeably to perform route-filtering via distribute-lists or filter-lists? Is there an advantage to using one over the other? Also, is there a best practice, considerations when deciding to use distribute lists vs. filter lists?

---

<div class="post-metadata">

**Author:** ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)\
**Post date:** [November 22, 2016, 3:07pm UTC](https://forum.networklessons.com/t/filter-list-vs-distribute-lists/757/2 "2016-11-22T15:07:14Z")

</div>

Hi Sheldon,

There are some important differences. When you refer to a distribute-list, you can choose between a number of options. For example here’s EIGRP:

```auto
R1(config)#router eigrp 1
R1(config-router)#distribute-list ?
  &lt;1-199&gt; IP access list number
  &lt;1300-2699&gt; IP expanded access list number
  WORD Access-list name
  gateway Filtering incoming updates based on gateway
  prefix Filter prefixes in routing updates
  route-map Filter prefixes based on the route-map

```

You can choose between an access-list, prefix-list or route-map.

If you want to match specific hosts, subnets or networks then you can use an access-list. You can achieve the same thing with a prefix-list but there is one thing that you can do with a prefix-list that you can’t with an access-list.

Let’s say you want to match all subnets in the 10.x.x.x range that have a subnet mask between /24 and /30. This can be achieved with a prefix-list, not with an access-list. You can find some examples here:

> **[How to configure Prefix-List on Cisco Router](https://networklessons.com/ip-routing/how-to-configure-prefix-list-on-cisco-router)**
>
> Prefix-lists are useful to filter prefixes by using the LE or GE operators. In this lesson, you learn how prefixes work.

> **[How to Filter Prefixes with Distribute-list](https://networklessons.com/eigrp/how-to-filter-prefixes-with-distribute-list)**
>
> The distribute list lets us filter prefixes inbound or outbound. In this lesson, you will learn how to do this with an access-list.

Other protocols like BGP are a bit more restrictive:

```auto
R1(config-router)#neighbor 192.168.12.2 filter-list ?
  &lt;1-500&gt; AS path access list

```

The filter list is only to filter AS paths, the distribute-list is only for access-lists:

```auto
R1(config-router)#neighbor 192.168.12.2 distribute-list ?
  &lt;1-199&gt; IP access list number
  &lt;1300-2699&gt; IP access list number (expanded range)
  WORD IP Access-list name

```

As a best practice, it’s best to use route-maps everywhere when possible:

```auto
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 route-map R2_FILTER out

```

```auto
R1(config)#router eigrp 1
R1(config-router)#distribute-list route-map R2_FILTER out

```

The reason for this is that the route-map offers a lot of different match options:

```auto
R1(config)#route-map R2_FILTER permit 10
R1(config-route-map)#match ?
  additional-paths BGP Add-Path match policies
  as-path Match BGP AS path list
  clns CLNS information
  community Match BGP community list
  extcommunity Match BGP/VPN extended community list
  interface Match first hop interface of route
  ip IP specific information
  ipv6 IPv6 specific information
  length Packet length
  local-preference Local preference for route
  mdt-group Match routes corresponding to MDT group
  metric Match metric of route
  mpls-label Match routes which have MPLS labels
  policy-list Match IP policy list
  route-type Match route-type of route
  rpki Match RPKI state of route
  security-group Security Group
  source-protocol Match source-protocol of route
  tag Match tag of route
  track tracking object

```

```auto
R1(config-route-map)#match ip address ?
  &lt;1-199&gt; IP access-list number
  &lt;1300-2699&gt; IP access-list number (expanded range)
  WORD IP access-list name
  prefix-list Match entries of prefix-lists

```

Not all route-map options are supported when you want to use it for filtering. Combining different options is also possible sometimes.

Rene

---

<div class="post-metadata">

**Author:** ![jermaindixon3](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@jermaindixon3](https://forum.networklessons.com/u/jermaindixon3)\
**Post date:** [November 24, 2018, 4:31pm UTC](https://forum.networklessons.com/t/filter-list-vs-distribute-lists/757/3 "2018-11-24T16:31:50Z")

</div>

I am bit new to distribution list, and prefix-list can you explain why they are being used for filtering are give an example of what they are being used for? Is it to reduce the size of the routing table so that every packet does not have to go through the entire routing table to forward packets?

1. Do route-maps use process switching or fast switching?
2. If route-maps use process switching and have to inspect every packet that is routed via different path why would you use it if it is CPU intensive?

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [November 30, 2018, 5:40pm UTC](https://forum.networklessons.com/t/filter-list-vs-distribute-lists/757/4 "2018-11-30T17:40:54Z")

</div>

Hello Jermaine

A distribute and prefix lists are used in order to filter particular routes from being learned via a routing protocol. You may want to do this in order to restrict access to these networks from particular areas of the network and to provide access to them from others. It all depends on what your requirements are. The point is not to make the routing table smaller, it just gives you control over what information you want to provide to particular routers on the network and what information you want to restrict. Distribute and prefix lists just function differently from each other. You can find out information about them on these lessons. The first two are the application of distribute lists for OSPF and EIGRP (which is almost identical) and the third is the application of prefix lists in EIGRP:

> **[OSPF Distribute-List Filtering](https://networklessons.com/ospf/ospf-distribute-list-filtering)**
>
> OSPF Filtering within the area is possible with the distribute-list. This lesson explains how it works.

> **[How to Filter Prefixes with Distribute-list](https://networklessons.com/eigrp/how-to-filter-prefixes-with-distribute-list)**
>
> The distribute list lets us filter prefixes inbound or outbound. In this lesson, you will learn how to do this with an access-list.

> **[How to configure Prefix-List on Cisco Router](https://networklessons.com/eigrp/how-to-configure-prefix-list-on-cisco-router)**
>
> Prefix-lists are useful to filter prefixes by using the LE or GE operators. In this lesson, you learn how prefixes work.

Now concerning your other questions:

According to the documentation below, policy based routing, which employs route maps, uses  
process switching. In order to employ fast switching for policy based routing, the `ip route-cache policy` interface configuration command must be issued.

> **[IP Routing: Protocol-Independent Configuration Guide, Cisco IOS Release 15S -...](https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_pi/configuration/15-s/iri-15-s-book/iri-fast-switched-policy-rtg.html)**
>
> IP Routing: Protocol-Independent Configuration Guide, Cisco IOS Release 15S-Fast-Switched Policy Routing

For more information about this particular command, take a look at this command reference link:

> **[Cisco IOS IP Switching Command Reference - ip cache-invalidate-delay through...](https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipswitch/command/isw-cr-book/isw-i1.html#wp3095189440)**
>
> Cisco IOS IP Switching Command Reference -ip cache-invalidate-delay through monitor event-trace cef ipv6 global

I hope this has been helpful!

Laz
