Redistribution: Route Tagging
“tag Tag value for destination routing protocol”
Tagging routes can help you prevent some big nasty routing loops, especially with 2-way redistribution. You can tag routes with a numeric value as they’re redistributed, and then prohibit routes with that same value from being “re-redistributed” back into the original routing protocol.
Example: Tagging routes with a value of 10 that are being redistributed from RIP into OSPF:
R1(config)#route-map RIP2OSPF permit 10 R1(config-route-map)#set tag 10
The redistribution config:
R1(config)#router ospf 1 R1(config-router)#redistribute rip route-map RIP2OSPF subnets R1(config-router)#redistribute connected subnets
You won’t see tag values in the routing table, but you will see them in the extended show ip route command with the network number specified.
R3#show ip route 126.96.36.199 Routing entry for 188.8.131.52/24 Known via "ospf 1", distance 110, metric 20 Tag 10, type extern 2, forward metric 64 Last update from 184.108.40.206 on Serial1, 00:00:43 ago Routing Descriptor Blocks: * 220.127.116.11, from 18.104.22.168, 00:00:43 ago, via Serial1 Route metric is 20, traffic share count is 1
The following config will prevent any routes with the tag 10 from being redistributed from OSPF back into RIP, while allowing any untagged routes to be redistributed and tagged with 20.
R1(config)#route-map OSPF2RIP deny 10 R1(config-route-map)#match tag 10 R1(config-route-map)#route-map OSPF2RIP perm 20 R1(config-route-map)#set tag 20
So we use ‘tagging’ to simply mark a route learned via redistribution and then ‘do something’ (Permit or Deny) to it using a route map.