how to set priority of routers in ospf

Ondrej Zajicek santiago at crfreenet.org
Tue Oct 27 21:17:23 CET 2009


On Tue, Oct 27, 2009 at 08:31:25PM +0100, Martin Kraus wrote:
> 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? 

If external route has defined valid ospf_metric2 metric, it is Type 2 external route
(flag E2 in 'show route'), if not, it is Type 1 external route
(flag E1 in 'show route'). Replace 'use Type X metric' with
'is a Type X external route' in mentioned rules.

Field ospf_metric1 is defined in all OSPF route types and contains contains
IGP metric (+ possibly initial value of Type 1 metric for type 1 external
routes)

> Both routes have type 1 metric 100 and one of them has type 2 10000 and the
> other has 10500. 
> ..
> 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? 

In both cases they are Type 2 external routes and are compared according
to ospf_metric2.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20091027/4a429b5f/attachment-0001.asc>


More information about the Bird-users mailing list