In my last blog How to interpret Cisco IP prefix lists, I mentioned that I would discuss using prefix lists to filter routes. Before we can go there, there is another piece of the puzzle which must be addressed. That piece is the topic of route maps. Let’s take a look at the concept of route maps and their importance in the network admin arena.
First of all, if you are already familiar with Access Control Lists (ACL), route maps won’t be such a giant leap. Secondly, there are some similarities between ACLs and route maps. Like ACLs, route maps are an ordered list of statements which are analyzed in sequence. If a matching statement occurs, processing of the list ceases and whatever the match says to do is done. You might wonder then why route maps exist if ACLs do the same thing. The answer to this rests on the meaning of the word ‘similar.’ While ACLs and route maps are similar, there are some crucial differences. While both may permit (or deny) certain routes being redistributed, route maps can actually modify certain aspects of the redistributed routes. This cannot be accomplished with ACLs.
The format of route maps is actually quite simple. Each statement typically consists of a match and a set command. I think of it as the tennis command!
It might make more sense to actually see an example of a route map and its consequences.
Test-rtr (config)# route-map RM-BGP permit 10
Test-rtr (config-route-map)# match ip address 125
Test-rtr (config-route-map)# set tag 5
Test-rtr (config)# route-map RM-BGP permit 20
Test-rtr (config-route-map)# set tag 10
Test-rtr (config)#router bgp 1
Test-rtr (config-router)# neighbor 18.104.22.168 remote-as 2
Test-rtr (config-router)# neighbor 22.214.171.124 route-map RM-BGP in
The first part of the route map command applies tag '5' to any route which matches the statements in ACL 125 (not shown) and tag '10' to any other route. The reason for the setting of tag '10' on everything else rests in deciphering the logic of the second part of the command. Notice that there is no 'match' statement prior to the second 'set' statement. This means 'match everything else.' The last statement also indicates that the route map affects inbound traffic. It turns out that route maps are always used to modify inbound traffic. They have no effect on outbound traffic. For reference, see Route-Maps for IP Routing Protocol Redistribution Configuration.
This is just a brief overview of route maps. I am trying to build, using small pieces, an overall picture of the use of prefix lists, route maps, and redistribution, to influence, modify, and control routing traffic on your router. I hope you stay tuned for the complete picture. Next time I will discuss the use of the redistribute command and try to tie together all these pieces.