External OSPF route cost metric

Christian Tacke Christian.Tacke+bird.network.cz at cosmokey.com
Mon Jul 13 11:50:16 CEST 2015


Hi Jigar,


On Sat, Jul 11, 2015 at 14:58:02 -0400, Jigar Mehta wrote:
> Hi,
> 
> Is there a way we can advertise external OSPF routes with the actual route
> cost instead of ospf.metric1 or ospf.metric2.
> For eg :
> Route to 5.5.5.0/24 is via protocol1 with cost of 5
> Route to 4.4.4.0/24 is via protocol1 with cost of 6
> but ospf advertises this external route with metric of 10000. (I know i can
> change the 10000 in the config) but both the routes will be advertised with
> the same cost instead of 5 or 6.
> I have assigned the protocol1 with highest preference but need to also
> advertise with the actual cost.
> Is it possible to use the filter and replace the ospf metric with the above
> route metric ?

Just some ideas / hints (use your own brain):

I assume those routes are already in a bird main table.
Try 
  show route all
to look at those routes and find the attribute with the
cost.  I hope it is something like kernel.cost or
something.

Then in your filter you can do:
  if ... then OSPF.metric1 = PROTO.attr * 100;

Let us know, how this works out.

If it does not work out, please let us know, which protocol
those routes come from and show us the output of "show
route all" for one of those routes.


> Thanks,
> JM

Cheers

Christian

-- 
www.cosmokey.com


More information about the Bird-users mailing list