Redistributing Routes Using Route Maps


You want to use route maps for more detailed control over how RIP redistributes routing information from other sources.


Route maps give you much better control over how RIP redistributes external routes. This example uses static routes, but the same principles apply when redistributing routes from other protocols:

Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#ip route
Router1(config)#ip route
Router1(config)#ip route
Router1(config)#access-list 20 permit
Router1(config)#access-list 21 permit
Router1(config)#route-map STATIC permit 10
Router1(config-route-map)#match ip address 20
Router1(config-route-map)#set metric 2
Router1(config-route-map)#set tag 2
Router1(config)#route-map STATIC permit 20
Router1(config-route-map)#match ip address 21
Router1(config-route-map)#set metric 8
Router1(config-route-map)#route-map STATIC deny 30
Router1(config)#router rip
Router1(config-router)#redistribute static route-map STATIC



In this example, we want RIP to distinguish among the different routes. There are two parameters that we can change, the metric and the route tag. We have already discussed metrics, which basically represent the distance or cost of the path to the remote network. A route tag is simply an arbitrary number that RIP will attach to a particular route. RIP doesn't actually use these tag values, but as we discuss in Recipe 6.17, RIP Version 2 will distribute them with the routing table so you can use this information when distributing these routes into other routing protocols.

The route map in this recipe has three clauses. The first assigns a metric of 2 and a tag of 2 to the network Then it gives a metric of 8 to The last clause discards all other routes. This is different from Recipe 6.3, in which all routes were redistributed with the same metric.

This kind of redistribution is useful when you want to control how traffic load is balanced between two links. For example, if you have two routers that both connect to the same set of remote networks, you could balance them so that one router has a better metric for half of the routes, and the other has a better metric for the rest of the routes. In this way, you can ensure that both links are used equally, and if one router fails, the other will take over for it.

It is often easier to understand route-maps by looking at the show route-map command rather than the configuration commands. In this case, for example, you can see exactly what access lists apply to each clause, along with all of the values that are set as a result. This output also shows how many times each policy has been applied:

Router1#show route-map STATIC
route-map STATIC, permit, sequence 10
 Match clauses:
 ip address (access-lists): 20 
 Set clauses:
 metric 2
 tag 2 
 Policy routing matches: 0 packets, 0 bytes
route-map STATIC, permit, sequence 20
 Match clauses:
 ip address (access-lists): 21 
 Set clauses:
 metric 8
 Policy routing matches: 0 packets, 0 bytes
route-map STATIC, deny, sequence 30
 Match clauses:
 Set clauses:
 Policy routing matches: 0 packets, 0 bytes

Looking at the RIP database, you can see the metrics that RIP uses for distributing each of these static routes:

Router1#show ip rip database auto-summary redistributed
 [2] via, auto-summary redistributed
 [8] via, 

You can also use the route map technique for distributing routes from dynamic routing protocols. For example, if you had another route map called EIGRPMAP that you wanted to use when redistributing routes learned through EIGRP process number 65530, you could configure the router like this:

Router1#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#router eigrp 65530
Router1(config)#router rip
Router1(config-router)#redistribute eigrp 65530 route-map EIGRPMAP


See Also

Recipe 6.3; Recipe 6.17

Router Configuration and File Management

Router Management

User Access and Privilege Levels


IP Routing





Frame Relay

Handling Queuing and Congestion

Tunnels and VPNs

Dial Backup

NTP and Time


Router Interfaces and Media

Simple Network Management Protocol





First Hop Redundancy Protocols

IP Multicast

IP Mobility




Appendix 1. External Software Packages

Appendix 2. IP Precedence, TOS, and DSCP Classifications


Cisco IOS Cookbook
Cisco IOS Cookbook (Cookbooks (OReilly))
ISBN: 0596527225
EAN: 2147483647
Year: 2004
Pages: 505 © 2008-2020.
If you may any questions please contact us: