Cost is the metric, OSPF uses to judge a path’s feasibility. Normally to adjust cost on a route you would adjust the cost value on an interface itself. This, however, affects all routes learned via this interface.
If router learns multiple routes to a destination, 1) Router first finds longest prefix match in IP routing table to find outgoing interface. 2) AD: If these multiple routes have same subnet mask learned via different protocol on router then router chooses lowest administrative distance (AD). Example: Router R1 learned 10.1.1.0/24 prefix via OSPF as well as by RIP, router chooses OSPF route as best and install in its routing table, because OSPF (110) has lower AD value than RIP (120) 3) If these multiple routes have same subnet mask learned via same protocol on router then router chooses lowest metric between them.
For Example: Eigrp use composite “metric” and Ospf uses “Cost” for comparison.
Unlike the metric in RIP which is determined by hop count and EIGRP’s long mathematical formulated metric, OSPF is a little simpler. OSPF automatic cost calculation is an inverse function of bandwidth of an interface. As higher the bandwidth values of an interface, the lower the cost value.
For cost calculation default reference bandwidth value used is 100Mbps (10^8).
Hence By default Interface Cost= 10^8/(interface bandwidth)
This mean for 100Mbps fast Ethernet will have a cost of 1 and furthermore all interface with higher bandwidth.The result of this is that OSPF routers in the network cannot make an accurate path calculation when comparing fast Ethernet interface versus a gigabit Ethernet interface as both interfaces has a cost of 1.
In order to resolve this, the reference bandwidth value can modified to allow higher bandwidth interface to have more granular cost value.
The "auto-cost reference-bandwidth" command allows you to change the reference bandwidth that OSPF uses to calculate its metrics:
Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#router ospf 100 Router(config-router)#auto-cost reference-bandwidth 1000 % OSPF: Reference bandwidth is changed. Please ensure reference bandwidth is consistent across all routers. Router(config-router)#exit
It is important to set the same reference bandwidth on all routers throughout the OSPF domain. Recall that OSPF allows every router to calculate its own routing table based on the LSAs that they receive. So they must all agree on the relationship between costs and bandwidth. Suppose you set the reference bandwidth differently on two routers, so that they advertise different link costs for their Ethernet interfaces. This could cause seriously strange routing patterns as OSPF will try to avoid using the higher cost links. For example, that a Fast Ethernet interface on one router is faster than a Gigabit Ethernet interface on the other route.
Since the OSPF cost derives from interface bandwidth, changing the interface bandwidth value should change the cost.
Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface Ethernet0 Router(config-if)#bandwidth 10000000 Router(config-if)# exit
The other way of affecting the cost of an interface is through the "ip ospf cost" command on the interface itself, this will override the calculated cost.
You can also set the cost per neighbor using the "neighbor (neighbor-ip) cost value" command. This command is valid only on OSPF network types that allow neighbor command like point-to-multipoint non broadcast.
Hi all, Are there diagrams which shows typical recent use cases for ncs 1000 and 2000 series optical platform, including 1004 if possible. What they would usually be connected to etc. I see documentation which describes the equipment themselves and t...
Hi there!I'm seeking some help and advice with our current network setup.Basically, as you can see from the network diagram attached; we're deploying vSAN Stretched Cluster between two data centers (2x Clusters with 4 hosts node in each cluster). We are a...
Hello Currently to access my 5508-X GUI (ASDM) I am using any IP on the 192.168.1.xinterface GigabitEthernet1/2nameif insidesecurity-level 100ip address 192.168.1.1 255.255.255.0 That GE 1/2 goes to a Catalyst Switch which has a vlan ip address ...
Hi, I'm looking to deploy a stack of catalyst 1000 series switches, specifically the 1000-48P-4G-L switch.I would like the stack act as the gateways for the VLANs, and do inter-vlan routing. How many SVIs are supported? I've tried doing som...
Hello everyone!I need some help with this issue I'm receiving in a Catalyst 3600, Version 16.12.4: %IOSXE-3-PLATFORM: 1 process kernel: ci_dump_write: task=SIF SR, write error: attempted=52 returned=-32. Does anyone have any idea what this...