Routing - route tagging
Route tagging is a technique used in routing when you configure multipoint redistribution between two routing domains. Tagging helps prevent readvertising a route that protocol A redistributed into protocol B, from being redistributed back into protocol A.
For example, take a look at the following diagram: Let’s say R1 redistributes the 126.96.36.199/24 network from routing protocol A into B. R2 will learn about this network from routing protocol B and it may redistribute it back into Routing Protocol A. This is something you want to avoid as it can create a routing loop. Such routing loops can be avoided using tagging.
When R1 redistributes network 188.8.131.52 /24 into routing protocol B, it should tag it. When R2 is going to redistribute routing information from routing protocol B into routing protocol, A it will notice the tag and skip redistribution for network 184.108.40.206 /24.
Tagging can be achieved by either using Route-maps to add tags to redistributed routes, or by using the
tag keyword in conjunction with the
redistribute command. Both of these examples can be seen below:
The following route-map configured on R1 will set the tag of a route to 1, while denying any routes with a tag that has a value of 1.
R1(config)#route-map TAG deny 10 R1(config-route-map)#match tag 1 R1(config-route-map)#exit R1(config)#route-map TAG permit 20 R1(config-route-map)#set tag 1
R1(config)#router rip R1(config-router)#redistribute ospf 1 metric 5 route-map TAG
R1(config)#router ospf 1 R1(config-router)#redistribute rip subnets route-map TAG
The above will not only tag redistributed routes but will prevent tagged routes from being re-redistributed.
The following is an example of tagging a route using the
R1(config)#router ospf 1 R1(config-router)#redistribuite eigrp 65005 subnet tag 12345678 R1(config-router)#summary address 172.16.0.0 255.255.0.0