how to set priority of routers in ospf

Ondrej Zajicek santiago at
Tue Oct 27 20:03:39 CET 2009

On Tue, Oct 27, 2009 at 07:21:54PM +0100, Martin Kraus wrote:
> Hello. I'm running ospf from a router against two other routers on the same
> ethernet segment. Those two routers a both capable of routing given prefixes,
> but I prefer one of them to do the actual routing and use the other one as a
> backup router in case of emergencies. How can I set such a preference? I
> thought of using ospf_metric2, but it is supposed to work only when
> ospf_metric1 isn't set, which is (checked using show route all). 
> For some reason the configuration does what I need, but I can't figure out
> why. Could anyone shed some light on this?

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.

Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago at
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3,
"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: <>

More information about the Bird-users mailing list