Thursday, February 20, 2020

How to configure Route Tagging

When you configure multipoint redistribution it’s a good idea to use route tagging to prevent advertising something from routing protocol “A” into “B” and back into “A”.  Let me give you an example:


redistribution multipoint
Above you see routing protocol A and B. At the bottom we find network 1.1.1.0 /24. Let’s say that R1 redistributes this network from routing protocol A into B. R2 will learn about this network from routing protocol B and will redistribute it back into Routing Protocol A. This is something you want to avoid and we can do it with route tagging…here’s an example:
redistribution routetagging
When R1 redistributes network 1.1.1.0 /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 1.1.1.0 /24.
Of course the same thing applies to R2. I’m only showing you the example for R1:
R1#show ip route 1.1.1.0
Routing entry for 1.1.1.0/24
 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 2
 Last update from 192.168.12.2 on FastEthernet0/0, 00:00:04 ago
 Routing Descriptor Blocks:
  * 192.168.12.2, from 192.168.45.4, 00:00:04 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1
You can use show ip route to check if a route has been tagged or not. Nothing has been tagged so far. Let’s configure route tagging:
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
You can tag routes using a route-map. I created a simple route-map called TAG with two sequence numbers:
  • Sequence number 10 says that when it matches tag number 1 that it should be denied.
  • Sequence number 20 says that we need to set tag number 1. There’s no “match” statement so EVERYTHING will match.
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
Now I need to make sure we use the route-map when redistributing. The example above is for redistributing into RIP and OSPF. At the end of your redistribution command you need to specify the route-map. Everything that is redistributed INTO RIP or OSPF will have a tag of 1. Once again I’m only showing R1 but you need to do this on R2 as well.
R2#show ip route 1.1.1.0
Routing entry for 1.1.1.0/24
  Known via "ospf 1", distance 110, metric 20
  Tag 1, type extern 2, forward metric 3
  Redistributing via rip
  Last update from 192.168.13.1 on FastEthernet0/0, 00:00:25 ago
  Routing Descriptor Blocks:
  * 192.168.13.1, from 192.168.45.4, 00:00:25 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1
      Route tag 1
If you look at this network you can now see that it has been tagged. This is because of the second part of our route-map:
route-map TAG permit 20
 set tag 1
Above you see the part of the route-map that did this tagging for us.
route-map TAG deny 10
 match tag 1
And this is the part of the route-map that prevents it from redistributing it again.
In other words…if your router sees something that has been tagged it will not be redistributed, otherwise it will be redistributed and a tag will be set.
This is a very simple solution to make sure you don’t inject routing information back into the routing protocol where it originated from. You have to do this on each router when you use multipoint redistribution!
I hope this has been helpful to you!

No comments:

Post a Comment