Route Tagging
Problem
You want RIP to include a tag when it distributes specific routes to prevent routing loops when redistributing between routing protocols.
Solution
RIP Version 2 allows you to tag external routes. For a static route, for example, the configuration looks like this:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#ip route
Router1(config)#
0.0.0.0 0.0.0.0 172.25.1.1
access-list
7
permit
Router1(config)#
0.0.0.0
route-map
TAGGING
permit
Router1(config-route-map)#
10
match ip address
Router1(config-route-map)#
7
set tag
Router1(config-route-map)#
5
exit
Router1(config)#router rip
Router1(config-router)#redistribute static route-map
Router1(config-router)#
TAGGING
exit
Router1(config)#end
Router1#
Discussion
You can only apply a route tag to external routes; that is, routes that are not learned from RIP. The example shows a static route, but you can apply a tag to routes learned from other routing protocols in exactly the same way. For example, the following code shows how to apply a tag to certain routes learned via EIGRP:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#access-list
7
permit
Router1(config)#
192.168.1.0
route-map
TAGGING
permit
Router1(config-route-map)#
10
match ip address
Router1(config-route-map)#
7
set tag
Router1(config-route-map)#
5
exit
Router1(config)#router eigrp
Router1(config-router)#
65530
network
Router1(config-router)#
192.168.1.0
exit
Router1(config)# ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.