I

222.211.10.0/24

222.211.10.0/24

When route summarization is enabled, OSPF uses the metric of the best route in the summary advertisement.

ip cost Interface Command

In Cisco IOS Software Release 10.2 and earlier, Cisco's implementation of OSPF assigned default costs to a router's interface, regardless of the bandwidth attached to the interface. For example, Cisco IOS Software would give a 64-kbps line and a T1 link the same OSPF cost—clearly a problem. This required the user to override the default value to take advantage of the faster link. Cisco IOS Software gave both the 64-kbps line and the T1 link the same cost because they were both on serial interfaces. Therefore, it is interface type that defined cost, not the actual bandwidth.

This overriding was accomplished through the use of the ip ospf cost value command, which would be placed on each interface as desired. By default, the cost of an interface is calculated based on the interface's bandwidth, but you can also place a cost on an interface through the use of the ip ospf cost value interface command. When setting a specific cost on an interface, that cost overrides all other OSPF cost considerations, specifically altering the reference bandwidth.

Trinity(config)#int fastethernet0/0 Trinity(config-if)#ip ospf cost ?

<1-65535> Cost Trinity(config-if)#ip ospf cost 10

NOTE Another way to change the OSPF metric is to simply change the interface bandwidth.

Changing the Reference Bandwidth

Another way of altering the way that Cisco IOS Software calculates OSPF cost is by altering the reference bandwidth value used by OSPF in calculating cost. The auto-cost reference-bandwidth ref-bw command is set under the OSPF routing process. The default reference bandwidth is 100, but this value is in Mbps, so in this case, 100 is really 100,000,000 bps. Keep this in mind when setting the value.

The following configuration caveats are associated with this command:

• The command is applied in OSPF configuration mode and thus globally alters the operation of that OSPF process.

• This command should be deployed throughout each area to keep the costs similar.

Earlier you saw how the current OSPF metric calculations have trouble dealing with highspeed links before the use of the reference-bandwidth command. Table 5-2 shows the default interface costs.

Table 5-2 OSPF Cost Without Reference Bandwidth

Link Type

Speed (divide by 108)

OSPF Cost

Ethernet

10,000,000

10

Fast Ethernet

100,000,000

1

Gigabit Ethernet

1,000,000,000

1

260 Chapter 5: Routing Concepts and Configuration

By altering the reference bandwidth for OSPF, you can have the costs adjusted to more clearly differentiate between link speeds.

Trinity(config)#router ospf 100

Trinity(config-router)#auto-cost reference-bandwidth ?

<1-4294967> The reference bandwidth in terms of Mbits per second

The new reference bandwidth, with a value of 100,000,000,000, allows OSPF to more accurately adjust cost, as shown in Table 5-3.

Table 5-3 OSPF Cost After Changing the Reference

Link Type

Speed (divide by 1010)

OSPF Cost

Ethernet

10,000,000

10000

Fast Ethernet

100,000,000

1000

Gigabit Ethernet

1,000,000,000

100

When using Cisco IOS Software Release 12.0 and later, the auto-cost reference-bandwidth is set as shown in the preceding syntax; however, in earlier versions of Cisco IOS Software, the command must be entered with the term ospf in the beginning, as follows:

ospf auto-cost reference-bandwidth ref-bw

You can see the interface metric through the use of the show ip ospf interface command, as demonstrated in Example 5-1.

Example 5-1 Displaying the Interface Metric

Trinity#show ip ospf interface

FastEthernet0/0 is up, line protocol is up Internet Address 192.168.254.71/24, Area 201

Process ID 100, Router ID 201.0.1.1, Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State UP, Priority 1 No designated router on this network No backup designated router on this network

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 FastEthernet0/1 is up, line protocol is up Internet Address 201.0.0.1/25, Area 201

Process ID 100, Router ID 201.0.1.1, Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State UP, Priority 1 No designated router on this network No backup designated router on this network

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Serial0/1.1 is up, line protocol is up Internet Address 201.0.1.1/30, Area 201

Process ID 100, Router ID 201.0.1.1, Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State UP,

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Trinity#

Continue reading here: Altering OSPF Convergence

Was this article helpful?

0 0