19-5 ip ospf cost cost

 <  Free Open Study  >  

19-5 ip ospf cost cost

Syntax Description:

  • cost ” OSPF metric to use for the interface. The range of values is 1 to 65535.

Purpose: By default OSPF calculates the cost of an interface by dividing the bandwidth of the interface into 100 million. Table 19-1 lists the costs for various interface types. Using the default value when your network has interfaces with a bandwidth greater than 100,000,000 bps is not recommended. OSPF will not be able to differentiate between a 100-Mbps interface and an interface with a bandwidth greater than 100 Mbps. The ip ospf cost command enables you to change the OSPF cost for an interface. The default reference value used to calculate the OSPF cost of an interface can be modified using the command auto-cost reference-bandwidth (see Section 3-1).

Table 19-1. Default OSPF Cost for Selected Interfaces
Interface Type Interface Bandwidth in Bits per Second (bps) OSPF Cost
Serial 56,000 1785
T1 1,544,000 64
Ethernet 10,000,000 10
Fast Ethernet 100,000,000 1
Gigabit Ethernet 1,000,000,000 1
OC48 2,500,000,000 1

Initial Cisco IOS Software Release: 10.0

Configuration Example: Modifying the OSPF Cost of an Interface

In Figure 19-2, the Ethernet network has an OSPF cost of 10. Configure Routers A and B as shown and verify the OSPF cost of the interface.

Figure 19-2. The Default Cost of an OSPF Interface Is 100,000,000 Divided by the Interface Bandwidth

graphics/19fig02.gif

 Router A  interface Loopback0   ip address 1.1.1.1 255.255.255.255   !   interface Ethernet0/0   ip address 172.16.1.1 255.255.255.0   !   router ospf 1   network 172.16.1.0 0.0.0.255 area 0   network 1.1.1.1 0.0.0.0 area 1  _______________________________________________________________ Router B  interface Loopback0   ip address 2.2.2.2 255.255.255.255   !   interface Ethernet0   ip address 172.16.1.2 255.255.255.0   !   router ospf 1   network 172.16.1.0 0.0.0.255 area 0   network 2.2.2.2 0.0.0.0 area 2  

The OSPF cost of an interface can be found by using the show ip ospf interface command.

 rtrA#  show ip ospf interface Ethernet0/0  Ethernet0/0 is up, line protocol is up   Internet Address 172.16.1.1/24, Area 0   Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST,  Cost: 10  Transmit Delay is 1 sec, State DR, Priority 1   Designated Router (ID) 1.1.1.1, Interface address 172.16.1.1   No backup designated router on this network   Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5     Hello due in 00:00:06   Neighbor Count is 0, Adjacent neighbor count is 0   Suppress hello for 0 neighbor(s) 

The cost to reach the loopback interface is the cost of the Ethernet interface plus the cost of the loopback interface, as shown here.

 rtrA#  show ip ospf interface loopback 0  Loopback0 is up, line protocol is up   Internet Address 1.1.1.1/32, Area 1   Process ID 1, Router ID 1.1.1.1, Network Type LOOPBACK,  Cost: 1  Loopback interface is treated as a stub Host rtrA#  show ip route  Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default        U - per-user static route, o - ODR Gateway of last resort is not set      1.0.0.0/32 is subnetted, 1 subnets C       1.1.1.1 is directly connected, Loopback0      2.0.0.0/32 is subnetted, 1 subnets O IA    2.2.2.2 [110/  11  ] via 172.16.1.2, 00:02:43, Ethernet0/0      172.16.0.0/24 is subnetted, 1 subnets C       172.16.1.0 is directly connected, Ethernet0/0      10.0.0.0/30 is subnetted, 1 subnets C       10.1.1.0 is directly connected, Serial0/1 

Modify the configuration on Routers A and B to change the cost of the Ethernet network to 100.

 Router A  interface Ethernet0/0   ip address 172.16.1.1 255.255.255.0    ip ospf  cost 100   _________________________________________________________________ Router B  interface Ethernet0   ip address 172.16.1.2 255.255.255.0    ip ospf cost 100   
Verification

Verify that the cost of the Ethernet interface is 100.

 rtrA#  show ip ospf interface ethernet 0/0  Ethernet0/0 is up, line protocol is up   Internet Address 172.16.1.1/24, Area 0   Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST,  Cost: 100  Transmit Delay is 1 sec, State BDR, Priority 1   Designated Router (ID) 2.2.2.2, Interface address 172.16.1.2   Backup Designated router (ID) 1.1.1.1, Interface address 172.16.1.1   Flush timer for old DR LSA due in 00:02:45   Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5     Hello due in 00:00:09   Neighbor Count is 1, Adjacent neighbor count is 1     Adjacent with neighbor 2.2.2.2  (Designated Router)   Suppress hello for 0 neighbor(s) 

Verify that the cost to reach the loopback network is now 101 (100 + 1).

 rtrA#  show ip route  Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default        U - per-user static route, o - ODR Gateway of last resort is not set      1.0.0.0/32 is subnetted, 1 subnets C       1.1.1.1 is directly connected, Loopback0      2.0.0.0/32 is subnetted, 1 subnets O IA    2.2.2.2 [110/  101  ] via 172.16.1.2, 00:02:43, Ethernet0/0      172.16.0.0/24 is subnetted, 1 subnets C       172.16.1.0 is directly connected, Ethernet0/0      10.0.0.0/30 is subnetted, 1 subnets C       10.1.1.0 is directly connected, Serial0/1 
Troubleshooting
Step 1. Verify that the correct cost has been used in the ip ospf cost interface command.

Step 2. For consistency, use the same cost for every interface attached to the same network.

 <  Free Open Study  >  


Cisco[r] OSPF Command and Configuration Handbook
Cisco OSPF Command and Configuration Handbook (paperback)
ISBN: 1587055406
EAN: 2147483647
Year: 2002
Pages: 236

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net