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 protocols A and B. At the bottom, we find network 1.1.1.0 /24. Let’s say R1 redistributes this network from routing protocol A into B. R2 will learn about this network from routing protocol B and 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.

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now!

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 804 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)
477 Sign Ups in the last 30 days
satisfaction-guaranteed

  • 100% Satisfaction Guaranteed!
  • You may cancel your monthly membership at any time.
  • No Questions Asked!

Tags: ,


Forum Replies

  1. Excellent article, Rene. Is this a way to prevent what they call asymmetric routing?

  2. It’s mostly used to prevent routing loops or sub-optimal routing paths that are caused by redistribution. Asymmetric routing doesn’t have to be a problem…when using IGPs (OSPF / EIGRP) you will mostly see symmetric routing but with BGP, asymmetric routing is likely to occur.

  3. hello,
    if the route map was writed in this way:

     Jack(config)#route-map TAG permit 10
    Jack(config-route-map)#set tag 1
    Jack(config-route-map)#exit
    Jack(config)#route-map TAG deny 20
    Jack(config-route-map)#match tag 1
    

    is the same thing?

  4. Hi Frank,

    It’s not the same thing. In the first permit 10 statement there is no “match” so it will match on everything and set the tag to 1. You will never make it to the “permit 20” statement since everything is permitted.

    Rene

  5. ip route 10.36.188.38 255.255.255.255 Serial0/0/0 10.36.148.222 tag 1
    route-map STATIC-TO-EIGRP permit 10
     match tag 1
    

    can you please explain this one to me please,

48 more replies! Ask a question or join the discussion by visiting our Community Forum