Redistribution: Route Tagging

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
Routing entry for
Known via "ospf 1", distance 110, metric 20
Tag 10, type extern 2, forward metric 64
Last update from on Serial1, 00:00:43 ago
Routing Descriptor Blocks:
*, from, 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.