Route Filtering And Route Maps Method | Best Explained in Easy Steps – 2024

Route Filtering and Route-Maps

What is Prefix List?

Prefix lists match routes rather than traffic. Two key elements are considered for matching routes:

  • The Prefix (the network itself)
  • The Prefix-length (the length of the subnet mask)

Consider the following prefix list example:

Router(config)# ip prefix-list MYLIST 10.1.1.0/24

The above command indicates that the prefix list matches the network 10.1.1.0/24 exactly. It will not match 10.1.0.0/16 or 10.1.1.4/30.

A range of prefix lengths can be set as follows:

Router(config)# ip prefix-list MYLIST 10.1.1.0/24 le 30
Router(config)# ip prefix-list MYLIST 10.1.1.0/24 ge 26 le 30

The first command shows that the list matches 10.1.1 with exactly 24 bits and a subnet mask less than or equal to 30 bits. The second command shows that the list matches 10.1.1 with exactly 24 bits and a subnet mask greater than or equal to 26 bits and less than or equal to 30 bits.

To match all prefixes in the network:

Router(config)# ip prefix-list MYLIST 0.0.0.0/0 le 32

To display the output of all prefix lists:

Router# show ip prefix-list detail

What is Distributed List?

A distributed list is used to filter routing updates, either incoming or outgoing. To use a distributed list, first set an access list or prefix list to match the network, then apply the distributed list under the routing process.

For example, to apply an access list to identify the routes:

Router(config)# access-list 10 permit ip 172.16.0.0 0.0.255.255
Router(config)# router rip
Router(config-router)# distribute-list 10 in serial0/0

The above distributed list will control the routes coming into serial0/0, and the access list matches only the permitted routes in the first two octets.

To use a prefix list to identify the routes:

Router(config)# ip prefix-list MYLIST 10.1.0.0/16
Router(config)# router rip
Router(config-router)# distribute-list prefix MYLIST out fa0/0

The above distributed command controls the routes outbound on port fa0/0, and the access list specifically matches the exact 10.1.0.0/16 route.

What is Access Control List (ACL) | What are the Types | How it Works? – 2024

What is Route Maps?

Route maps are an advanced technique used to perform several functions, including:

  • Controlling the redistribution between routing protocols
  • Adjusting the attributes of routes in BGP
  • Implementing Policy-Based Routing

Using an access list, route maps are formed on a specific sequential set of rules where permit and deny conditions occur.

Route maps follow two simple rules:

  1. First, the traffic is matched.
  2. Second, a particular attribute or action is set.

In route maps, each statement sets a sequence number that traverses from low to high. Further, it will match the traffic and then set the traffic to that path.

The following briefly explains the syntax of route map commands:

Router(config)# access-list 1 permit 10.1.1.0 0.0.0.255
Router(config)# route-map MYMAP permit 10
Router(config-route-map)# match ip address 1
Router(config-route-map)# set ip next-hop 192.168.1.1

The first command indicates that the permit statement allows the network 10.1.1.0/24. The second command shows the route map with the permit condition and the sequence number. The third command displays the match for the traffic defined in access-list 1. Finally, the fourth command displays the set action on the destined traffic to 192.168.1.1 (for instance).

Route Maps Criteria

These the following attribute that matched by Route Maps

Route Filtering and Route-Maps

This Post Has One Comment

Leave a Reply