OSPF Metric Cost

  • OSPF uses the OSPF cost in order to calculate the best path to the destination. This cost comes from the speed your interfaces are operating at.
    As you can see below, we have different types of interfaces, each with a cost number assigned.

    Diagram showing OSPF metric cost values on different interfaces between routers

    Figure 1 – OSPF cost per interface

    To check the OSPF cost on our interfaces, we can use show ip ospf interface brief

    R1# show ip ospf interface brief
    Interface             PID   Area    IP Address/Mask            Cost  State  Nbrs
    FastEthernet0/0         1   0     192.168.10.1/255.255.255.0   1     DR     0/0
    GigabitEthernet0/0      1   0     192.168.12.1/255.255.255.0   1     DR     0/0
    GigabitEthernet0/1      1   0     192.168.13.1/255.255.255.0   1     BDR    0/0
    Ethernet0/0             1   0     192.168.11.1/255.255.255.0   100   DR     0/0

    Here, we can clearly see that:

    • FastEthernet and GigabitEthernet interfaces have a cost of 1

    • Ethernet (10 Mbps) has a cost of 100

    OSPF uses these values to evaluate the efficiency of each OSPF link.
    The lower the cost, the more preferred the path.

    Answer the question below