ip ospf cost is a Cisco IOS interface-configuration command that directly assigns an OSPF cost to a specific interface. OSPF adds interface costs across a route and prefers the lowest total cost. section 18.1.3 section 18.5
Use the command when you need to make one link more or less preferable.
- Enter interface configuration mode and use ip ospf cost cost. section 18.1.3
- Prefer this method over changing bandwidth when only OSPF path selection should change; bandwidth values can also affect QoS and other metrics. section 18.1.3
- Remember that equal cumulative costs can produce ECMP load balancing. section 18.1.3
Prefer a specific link
R1(config)# interface GigabitEthernet0/0 R1(config-if)# ip ospf cost десять The configured value replaces the interface’s automatically calculated OSPF cost for path selection. section 18.1.3
Figure 18.3 A route’s cost is the cumulative cost of each interface out of which a packet must be sent to reach the destination. R1’s cost to reach 192.168.3.0/24 is 3: 1 for R1 G0/0, plus 1 for R2 G0/1, plus 1 for R3 G0/1.
Trace how individual interface costs accumulate into a route’s total OSPF cost. section 18.1.3
