how to set priority of routers in ospf

Martin Kraus martin.kraus at wujiman.net
Tue Oct 27 20:31:25 CET 2009


On Tue, Oct 27, 2009 at 08:03:39PM +0100, Ondrej Zajicek wrote:
> I suppose that both routers propagate some external route and you
> want to set metric for that external route.
> 
> For this purpose, you can use Type 1 metric (ospf_metric1) or
> Type 2 metric (ospf_metric2), both will work. Just set smaller
> value to more preferred router.
> 
> If router receives both routes and both use Type 2 metric,
> then it compares just these metrics and uses the smaller one.
> If router receives both routes and both use Type 1 metric,
> then it compares these metrics icreased by IGP metric between
> both routers, which is the same value for both routes in your case.
> 
> RFC 2328: Type 1 external metrics are expressed in the same units as
> OSPF interface cost (i.e., in terms of the link state metric). Type 2
> external metrics are an order of magnitude larger; any Type 2 metric is
> considered greater than the cost of any path internal to the AS.

I'm still a bit confused. If both routes use type 2 then bird compares type 2.
If both routes use type 1 then bird compares type 1. But if both contain type
2 as well as type 1, which of those two rules is used? 
Both routes have type 1 metric 100 and one of them has type 2 10000 and the
other has 10500. Bird selects the first route with smaller type 2 metric, but
it doesn't fit those two rules for selecting routes. Bird shows all routes
from ospf, internal as well as external, as having type 1 metric which is
equal to the sum of costs from this router to the destination. How can you
configure a route to use only type 2 metric? 
If I have two external routes, first with type1 = 1 and type2 = 100 and the
other one with type1 = 5 and type2 = 50 (as is show by show route all),
which will be used? 

thanks
mk



More information about the Bird-users mailing list