11-21-2011 11:08 PM - edited 03-07-2019 03:31 AM
Lets assume there are 2 routes to a remote destination with equal cost. But one is 1Gbps line and other one is 100Mbps.
How does OSPF handle this situation?
Krishna
11-21-2011 11:12 PM
Hello,
You will see routes installed in the routing table. And then CEF(if enabled) will take care of the rest. Actually Per destination load balancing is used.
HTH,
Toshi
11-21-2011 11:16 PM
What if I want to make the 1Gbps line my preffered route? How should I tweak the cost formula?
Krishna
11-21-2011 11:18 PM
Hello,
Sure you can. You can modify cost on 100M to be worst(65535) as well.
HTH,
Toshi
11-22-2011 12:58 AM
Hi,
You can
1) modify the cost per interface with the interface command: ip ospf cost
2) modify the reference-bandwidth used to automatically calculate the cost with this OSPF process command:
ospf auto-cost reference -bandwidth
But this command will affect the cost of all interfaces and first command overrides the cost per interface
Regards.
Alain
11-22-2011 01:24 AM
Hi All,
Just wanted to add quickly to what Alain said about the reference bandwidth.
The default reference bandwidth of 100 calculates all links of speed 100Meg AND ABOVE with a cost of 1. This became a problem for us when we moved to 1Gig, and then 10Gig and 44 Gig interlinks. We were having to manually configure the link costs for every link and sometimes people would forget and routing wouldn't work as expected.
What we now do is on every OSPF device, we set the reference bandwitdh as stated above by Alain. the Value we chose to set on all devices is 100,000 as this would alllow us to in future have 100Gig links with a cost of 1.
I'm not suggesting you adopt this, as the decision is based upon the speed of your links and the size of your network. You may also decide to manually set speeds, which has less of an impact when implementing on a live network.
Below is a chart that I made up at the time in order to make the decision. Note that if any route's cost grows to 65535 it gets classed as unreachable and will not get installed in the routing table, so if you have lots of low bandwitdh links, you need to take this into account.
Reference Bandwidth | 44Gig | 10Gig | 1Gig | 100Meg | 10Meg | 8Meg | 2meg | 1Meg | 512k | 256k | |
Default | 100 | 1 | 1 | 1 | 1 | 10 | 13 | 50 | 100 | 195 | 391 |
1,000 | 1 | 1 | 1 | 10 | 100 | 125 | 500 | 1,000 | 1,953 | 3,906 | |
10,000 | 1 | 1 | 10 | 100 | 1,000 | 1,250 | 5,000 | 10,000 | 19,531 | 39,063 | |
44,000 | 1 | 4 | 44 | 440 | 4,400 | 5,500 | 22,000 | 44,000 | 65,535 | 65,535 | |
100,000 | 2 | 10 | 100 | 1,000 | 10,000 | 12,500 | 50,000 | 65,535 | 65,535 | 65,535 | |
200,000 | 5 | 20 | 200 | 2,000 | 20,000 | 25,000 | 65,535 | 65,535 | 65,535 | 65,535 | |
300,000 | 7 | 30 | 300 | 3,000 | 30,000 | 37,500 | 65,535 | 65,535 | 65,535 | 65,535 |
Be careful doing this, as Alain said - applying the command will change the automatically calculated costs of every interface on the device which hasn't had its cost set manually, so this might cause routing issues if you are not careful.
Hope that Helps,
Nick
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide