While playing around with IOS and quagga routers I noticed an interesting behaviour. While the loopback IP's of my IOS routers did have a considerable cost value in the routing table, here 10.255.255.1

R1#sh ip route 10.255.255.2
Routing entry for 10.255.255.2/32
  Known via "ospf 1", distance 110, metric 101, type intra area
  Last update from 10.0.0.2 on GigabitEthernet1/0, 00:19:06 ago
  Routing Descriptor Blocks:
  * 10.0.0.2, from 10.255.255.2, 00:19:06 ago, via GigabitEthernet1/0
      Route metric is 101, traffic share count is 1

the quagga loopback interaces had a lot higher metric, see here 10100

R1#sh ip route 10.255.254.1
Routing entry for 10.255.254.1/32
  Known via "ospf 1", distance 110, metric 10100, type intra area
  Last update from 10.0.0.18 on GigabitEthernet6/0, 00:00:08 ago
  Routing Descriptor Blocks:
  * 10.0.0.18, from 10.255.254.1, 00:00:08 ago, via GigabitEthernet6/0
      Route metric is 10100, traffic share count is 1

My first thought was to configure the same auto-cost reference bandwidth across all routers. Unfortunatelly it did not change anything. The metric was still the same. Here as seen on IOS:

R1#sh run | sec router.ospf           
router ospf 1
 auto-cost reference-bandwidth 100000

Here as seen on quagga:

router ospf
 ospf router-id 10.255.254.1
! Important: ensure reference bandwidth is consistent across all routers
 auto-cost reference-bandwidth 100000

I like the commented out notice in quagga, it is there by default. Second thought was to configure the bandwith on the quagga eth0 interface, so set and done

interface eth0
 bandwidth 1000000

Still, nothing has changed the IP prefix has the same metric 10100, depending on which router you look. So which configuriaton leads to such high metric cost on quagga loopback interface? The solution was to look over the show ip ospf interface command on both router platforms:

R1#sh ip ospf interface lo0
Loopback0 is up, line protocol is up 
  Internet Address 10.255.255.1/32, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 10.255.255.1, Network Type LOOPBACK, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Enabled by interface config, including secondary ip addresses
  Loopback interface is treated as a stub Host

So as IOS has default cost for a loopback interace set to 1. The quagga platform has following settings:

R2# sh ip ospf interface lo
lo is up
  ifindex 1, MTU 16436 bytes, BW 0 Kbit <UP,LOOPBACK,RUNNING>
  Internet Address 10.255.254.1/32, Area 0.0.0.0
  MTU mismatch detection:enabled
  Router ID 10.255.254.1, Network Type LOOPBACK, Cost: 10000
  Transmit Delay is 1 sec, State Loopback, Priority 1
  No designated router on this network
  No backup designated router on this network
  Multicast group memberships: <None>
  Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
    Hello due in inactive
  Neighbor Count is 0, Adjacent neighbor count is 0

The quagga router has a default cost set to 10000 on loopback interfaces. This was unexpected. And the solution was to explicitely configure the desired metric/cost for the loopback interface. Set and done:

interface lo
 ip ospf cost 1

Then everything looked sane again

R1#sh ip route | i 10.255.254.1
O        10.255.254.1/32 [110/101] via 10.0.0.18, 00:00:39, GigabitEthernet6/0

The lesson learnt was to configure services the way you expect them to work, and do not leave things at default or unconfigured, even if it worked that way past 20 years. Vendors change things and a firmware update on $vendor box might lead to unexpected behaviour if leaving things on default values that have been true for last years.