Showing results for 
Search instead for 
Did you mean: 

BGP-OSPF route redistribution, filtering routes by tags.

Dear community,

Recently, I have been analyzing a network where there are two border routers redistributing OSPF into BGP and viceversa. They are using route-maps to filter routes and setting some parameters such as as-path prepend in order to make router1 the preferred one for other routers in the BGP side.  

I have been reading but I can't find answer to the following questions:

My question is regarding tags that are set when redistributing one protocol into another. 1. Are tags local numbers to identify routes inside the routing table? or 2. Are tags sent to other routers when sharing routing information?

On the other hand, when redistributing routes from one protocol into another, 3. What is the default metric that is assigned if you don't set it manually?

Thank you very much for your attention.


Dear Julio,

Dear Julio,

This is a very a good question, but most important regarding the use of route tags, a powerful tool to manage an control route redistribution. Route tags are numbers/IDs that you set to IP prefixes using a route-map sentence and that stay with the prefix across the network. Generally and mostly they are set when redistributing, from an EGP to and IGP or when doing it from an IGP to another IGP (different AS while using the same IGP protocol or just form different IGPs). So, they work remotely hop by hop/router by router (not only locally) and they are useful for identifying where the IP prefix is coming/entering from (even better if configured together with "router IDs") or to create new routing policies based on these tags (for example to avoid loops when two way redistribution exists in multihomed environments).

For the second question its important to mention that when redistributing routes/prefixes, some IGP protocols will do it without setting a proper metric, for example IGRP to EIGRP redistribution, but this is just an exception taking into account that EIGRP is the successor of IGRP, so they share some structures and metric calculation (in the case of EIGRP just multiplying IGRP metric by a value/constant). In the rest of the routing protocols redistribution it will happens only if a metric is set. In your case (BGP/OSPF), metric for external routes from BGP will needed to be set int the OSPF routing process. As you probably know OSPF metric is cost, but in terms of external routes you will find the concept of E1 and E2 routes. This goal could be accomplished in different ways, but we agree that one kind of metric parameter will be needed to set; a default-metric, an E1/ E2 or a seed metric. E2 is the default method when redistributing, so the cost of the external route will be 20 unless the EGP is BGP, in this case (yours) is 1. Also think about that by default OSPF will receive only the classfull prefixes, if you would like to redistribute the minor classless ones you will have to use the reserved keyword "subnets" (in the redistribute command applied to the BGP routing process).

For further info I recommend the reading of the chapters involved in the Cisco book "CCNP Routing 300-101" used for CCNP route certification.

Carpe Diem.



Hi Julio,

Hi Julio,

  1. When you configure multipoint redistribution route tagging is used to prevent advertising something from routing protocol “A” into “B” and back into “A”, the tags are sent to other routers when advertising routes.
  2. When redistributing from IGP to BGP, the IGP metric is copied in BGP MED attribute.
  3. When redistributing from BGP to IGP :
      • you need to use an array of parameters when redistributing into EIGRP (Delay, Bandwidth, Reliability and Load)
      • be careful with MED higher that 16 when redistributing into RIP (hop count of 16 is considered an infinite distance and the route is considered unreachable)
      • be careful with OSPF Metric-Type when redistributing into OSPF (E1 will add metrics at each hop | E2 will not change or increment metric value along a path)

I hope this could help you.

Best regards.

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards