Lab - Configuring Basic Single-Area OSPFv2

Cisco Packet Tracer

Topology

Addressing Table

Step 1: Configure basic settings for each router.

  • R1

Router>enable
Router#configure terminal 
Router(config)#hostname R1
R1(config)#int fa0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#description LINK_2_LAN
R1(config-if)#exit
R1(config)#int s0/0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#clock rate 64000
R1(config-if)#description LINK_2_R2
R1(config-if)#exit
R1(config)#int s0/1/0
R1(config-if)#ip address 192.168.13.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#description LINK_2_R3
  • R2

Router>enable
Router#configure terminal 
Router(config)#hostname R2
R2(config)#int fa0/0
R2(config-if)#ip address 192.168.2.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#description LINK_2_LAN
R2(config-if)#exit
R2(config)#int s0/0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.252
R2(config-if)#no shut
R2(config-if)#description LINK_@
R2(config-if)#description LINK_2_R1
R2(config-if)#exit
R2(config)#int s0/1/0
R2(config-if)#int s0/1/0
R2(config-if)#ip address 192.168.23.1 255.255.255.252
R2(config-if)#no shut
R2(config-if)#clock rate 64000
R2(config-if)#description LINK_2_R3
  • R3

Router>enable 
Router#configure terminal 
Router(config)#hostname R3
R3(config)#int fa0/0
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#description LINK_2_LAN
R3(config-if)#exit
R3(config)#int s0/0/0
R3(config-if)#ip add
R3(config-if)#ip address 192.168.13.2 255.255.255.252
R3(config-if)#no shut
R3(config-if)#clock rate 64000
R3(config-if)#description LINK_2_R1
R3(config-if)#exit
R3(config)#int s0/1/0
R3(config-if)#ip address 192.168.23.2 255.255.255.252
R3(config-if)#no shut
R3(config-if)#description LINK_2_R2

Step 2: Configure PC hosts.

  • PC-A

PC-A>ipconfig /all

FastEthernet0 Connection:(default port)

   Connection-specific DNS Suffix..: 
   Physical Address................: 00E0.A31D.1D07
   Link-local IPv6 Address.........: FE80::2E0:A3FF:FE1D:1D07
   IP Address......................: 192.168.1.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.1.1
   DNS Servers.....................: 0.0.0.0
   DHCP Servers....................: 0.0.0.0
   DHCPv6 Client DUID..............: 00-01-00-01-43-91-3E-CD-00-E0-A3-1D-1D-07


PC-A>
  • PC-B

PC-B>ipconfig /all

FastEthernet0 Connection:(default port)

   Connection-specific DNS Suffix..: 
   Physical Address................: 0060.702E.2550
   Link-local IPv6 Address.........: FE80::260:70FF:FE2E:2550
   IP Address......................: 192.168.2.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.2.1
   DNS Servers.....................: 0.0.0.0
   DHCP Servers....................: 0.0.0.0
   DHCPv6 Client DUID..............: 00-01-00-01-B9-7A-EE-15-00-60-70-2E-25-50


PC-B>
  • PC-C

PC-C>ipconfig /all

FastEthernet0 Connection:(default port)

   Connection-specific DNS Suffix..: 
   Physical Address................: 0050.0F13.C7D4
   Link-local IPv6 Address.........: FE80::250:FFF:FE13:C7D4
   IP Address......................: 192.168.3.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.3.1
   DNS Servers.....................: 0.0.0.0
   DHCP Servers....................: 0.0.0.0
   DHCPv6 Client DUID..............: 00-01-00-01-BD-30-0B-12-00-50-0F-13-C7-D4


PC-C>

Step 2: Configure OSPF on R1.

  • Use the router ospf command in global configuration mode to enable OSPF on R1.

R1(config)#router ospf 1
R1(config-router)#

Note: The OSPF process id is kept locally and has no meaning to other routers on the network.

  • Configure the network statements for the networks on R1. Use an area ID of 0.

R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.12.0 0.0.0.3 area 0
R1(config-router)#network 192.168.13.0 0.0.0.3 area 0

Step 3: Configure OSPF on R2.

R2(config)#router ospf 1
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
R2(config-router)#network 192.168.12.0 0.0.0.3 area 0
R2(config-router)#network 192.168.23.0 0.0.0.3 area 0

Step 4: Configure OSPF on R3.

R3(config)#router ospf 1
R3(config-router)#network 192.168.3.0 0.0.0.255 area 0
R3(config-router)#network 192.168.13.0 0.0.0.3 area 0
R3(config-router)#network 192.168.23.0 0.0.0.3 area 0

Step 5: Verify OSPF neighbors and routing information.

  • Issue the show ip ospf neighbor command to verify that each router lists the other routers in the network as neighbors.

R1#show ip ospf neighbor 


Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.23.1      0   FULL/  -        00:00:33    192.168.12.2    Serial0/0/0
192.168.23.2      0   FULL/  -        00:00:32    192.168.13.2    Serial0/1/0
R1#
  • Issue the show ip route command to verify that all networks display in the routing table on all routers.

R1#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, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, FastEthernet0/0
O    192.168.2.0/24 [110/65] via 192.168.12.2, 00:10:13, Serial0/0/0
O    192.168.3.0/24 [110/65] via 192.168.13.2, 00:09:22, Serial0/1/0
     192.168.12.0/30 is subnetted, 1 subnets
C       192.168.12.0 is directly connected, Serial0/0/0
     192.168.13.0/30 is subnetted, 1 subnets
C       192.168.13.0 is directly connected, Serial0/1/0
     192.168.23.0/30 is subnetted, 1 subnets
O       192.168.23.0 [110/128] via 192.168.12.2, 00:09:22, Serial0/0/0
                     [110/128] via 192.168.13.2, 00:09:22, Serial0/1/0
R1#
R2#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, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

O    192.168.1.0/24 [110/65] via 192.168.12.1, 00:10:41, Serial0/0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
O    192.168.3.0/24 [110/65] via 192.168.23.2, 00:09:50, Serial0/1/0
     192.168.12.0/30 is subnetted, 1 subnets
C       192.168.12.0 is directly connected, Serial0/0/0
     192.168.13.0/30 is subnetted, 1 subnets
O       192.168.13.0 [110/128] via 192.168.12.1, 00:09:50, Serial0/0/0
                     [110/128] via 192.168.23.2, 00:09:50, Serial0/1/0
     192.168.23.0/30 is subnetted, 1 subnets
C       192.168.23.0 is directly connected, Serial0/1/0
R2#
R3#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, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

O    192.168.1.0/24 [110/65] via 192.168.13.1, 00:10:13, Serial0/0/0
O    192.168.2.0/24 [110/65] via 192.168.23.1, 00:10:13, Serial0/1/0
C    192.168.3.0/24 is directly connected, FastEthernet0/0
     192.168.12.0/30 is subnetted, 1 subnets
O       192.168.12.0 [110/128] via 192.168.13.1, 00:10:13, Serial0/0/0
                     [110/128] via 192.168.23.1, 00:10:13, Serial0/1/0
     192.168.13.0/30 is subnetted, 1 subnets
C       192.168.13.0 is directly connected, Serial0/0/0
     192.168.23.0/30 is subnetted, 1 subnets
C       192.168.23.0 is directly connected, Serial0/1/0
R3#

Step 6: Verify OSPF protocol settings.

  • The show ip protocols command is a quick way to verify vital OSPF configuration information. This information includes :

    • OSPF process ID

    • Router ID

    • Networks the router is advertising

    • Neighbors the router is receiving updates from

    • Default administrative distance (which is 110 for OSPF)

R1#show ip protocols 

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Router ID 192.168.13.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.1.0 0.0.0.255 area 0
    192.168.12.0 0.0.0.3 area 0
    192.168.13.0 0.0.0.3 area 0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    192.168.13.1         110      00:29:45
    192.168.23.1         110      00:29:51
    192.168.23.2         110      00:29:47
  Distance: (default is 110)

R1#

Step 7: Verify OSPF process information.

  • Use the show ip ospf command to examine the OSPF process ID and router ID. This command displays the OSPF area information, as well as the last time the SPF algorithm was calculated.

R1#show ip ospf
 Routing Process "ospf 1" with ID 192.168.13.1
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 External flood list length 0
    Area BACKBONE(0)
        Number of interfaces in this area is 3
        Area has no authentication
        SPF algorithm executed 7 times
        Area ranges are
        Number of LSA 3. Checksum Sum 0x00b9a0
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

R1#

Step 8: Verify OSPF interface settings.

  • Issue the show ip ospf interface brief command to display a summary of OSPF-enabled interfaces.

R1# show ip ospf interface brief
Interface	PID	Area	IP Address/Mask	 Cost	 State	Nbrs	F/C
Se0/1/0		1 	0 	  192.168.13.1/30  64 	 P2P 	  1/1
Se0/0/0		1 	0 	  192.168.12.1/30  64 	 P2P 	  1/1
fa0/0 		1 	0 	  192.168.1.1/24 	 1 	   DR 	  0/0
  • For a more detailed list of every OSPF-enabled interface, issue the show ip ospf interface command.

R1#show ip ospf interface 

FastEthernet0/0 is up, line protocol is up
  Internet address is 192.168.1.1/24, Area 0
  Process ID 1, Router ID 192.168.13.1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 192.168.13.1, Interface address 192.168.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:08
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
Serial0/0/0 is up, line protocol is up
  Internet address is 192.168.12.1/30, Area 0
  Process ID 1, Router ID 192.168.13.1, Network Type POINT-TO-POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT-TO-POINT, Priority 0
  No designated router on this network
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:01
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 192.168.23.1
  Suppress hello for 0 neighbor(s)
Serial0/1/0 is up, line protocol is up
  Internet address is 192.168.13.1/30, Area 0
  Process ID 1, Router ID 192.168.13.1, Network Type POINT-TO-POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT-TO-POINT, Priority 0
  No designated router on this network
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:02
  Index 3/3, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 192.168.23.2
  Suppress hello for 0 neighbor(s)
R1#

Step 9: Verify end-to-end connectivity.

PC-A>ping 192.168.2.3

Pinging 192.168.2.3 with 32 bytes of data:

Reply from 192.168.2.3: bytes=32 time=1ms TTL=126
Reply from 192.168.2.3: bytes=32 time=1ms TTL=126
Reply from 192.168.2.3: bytes=32 time=1ms TTL=126
Reply from 192.168.2.3: bytes=32 time=24ms TTL=126

Ping statistics for 192.168.2.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 24ms, Average = 6ms

PC-A>ping 192.168.3.3

Pinging 192.168.3.3 with 32 bytes of data:

Reply from 192.168.3.3: bytes=32 time=2ms TTL=126
Reply from 192.168.3.3: bytes=32 time=1ms TTL=126
Reply from 192.168.3.3: bytes=32 time=1ms TTL=126
Reply from 192.168.3.3: bytes=32 time=1ms TTL=126

Ping statistics for 192.168.3.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 2ms, Average = 1ms

PC-A>

Step 10: Change router IDs using loopback addresses.

The OSPF router ID is used to uniquely identify the router in the OSPF routing domain. Cisco routers derive the router ID in one of three ways and with the following precedence:

1) IP address configured with the OSPF router-id command, if present

2) Highest IP address of any of the router’s loopback addresses, if present

3) Highest active IP address on any of the router’s physical interfaces

  • Assign an IP address to loopback 0 on R1.

R1(config)#int loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#end
R1#
  • Assign IP addresses to Loopback 0 on R2 and R3. Use IP address 2.2.2.2/32 for R2 and 3.3.3.3/32 for R3.

R2(config)#int loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R3(config)#int loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
  • You must reload the routers in order to reset the router ID to the loopback address. Issue the reload command on all three routers. Press Enter to confirm the reload.

R1#reload
Proceed with reload? [confirm]
R2#reload
Proceed with reload? [confirm]
R3#reload
Proceed with reload? [confirm]

The clear ip ospf process command does not reset the router IDs with the loopback address. Reloading the router will reset the router ID to the loopback address.

  • After the router completes the reload process, issue the show ip protocols command to view the new router ID.

R1#show ip protocols 

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Router ID 1.1.1.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.1.0 0.0.0.255 area 0
    192.168.12.0 0.0.0.3 area 0
    192.168.13.0 0.0.0.3 area 0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    1.1.1.1              110      00:01:41
    2.2.2.2              110      00:01:41
    3.3.3.3              110      00:01:41
    192.168.23.2         110      00:03:11
  Distance: (default is 110)

R1#

Step 11: Change the router ID on R1 using the router-id command.

  • Issue the router-id 11.11.11.11 command on R1 to reassign the router ID. Notice the informational message that appears when issuing the router-id command.

R1(config-router)#router-id 11.11.11.11
R1(config-router)#Reload or use "clear ip ospf process" command, for this to take effect


R1(config-router)#^Z
R1#clear ip ospf process
Reset ALL OSPF processes? [no]: 

R1#

You will receive an informational message telling you that you must either reload the router or use the clear ip ospf process command for the change to take effect. Issue the clear ip ospf process command on all three routers. Type yes to reply to the reset verification message, and press ENTER.

  • Issue the show ip protocols command to verify that the router ID changed on R1.

R1#show ip protocols 

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Router ID 11.11.11.11
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.1.0 0.0.0.255 area 0
    192.168.12.0 0.0.0.3 area 0
    192.168.13.0 0.0.0.3 area 0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    1.1.1.1              110      00:22:46
    2.2.2.2              110      00:02:35
    3.3.3.3              110      00:02:35
    11.11.11.11          110      00:02:37
    192.168.23.2         110      00:24:16
  Distance: (default is 110)

R1#
  • Issue the show ip ospf neighbor command on R1 to verify that new router ID for R2 and R3 is listed.

R1#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/  -        00:00:34    192.168.12.2    Serial0/0/0
3.3.3.3           0   FULL/  -        00:00:33    192.168.13.2    Serial0/1/0
R1#

Step 12: Configure OSPF Passive Interfaces

The passive-interface command prevents routing updates from being sent through the specified router interface.

  • Issue the show ip ospf interface fa0/0 command on R1. Notice the timer indicating when the next Hello packet is expected. Hello packets are sent every 10 seconds and are used between OSPF routers to verify that their neighbors are up.

R1#show ip ospf interface fastEthernet 0/0

FastEthernet0/0 is up, line protocol is up
  Internet address is 192.168.1.1/24, Area 0
  Process ID 1, Router ID 11.11.11.11, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 11.11.11.11, Interface address 192.168.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:04
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
R1#
  • Issue the passive-interface command to change the fa0/0 interface on R1 to passive.

R1(config)#router ospf 1
R1(config-router)#passive-interface fa0/0
  • Re-issue the show ip ospf interface fa0/0 command to verify that fa0/0 is now passive.

R1#show ip ospf interface fastEthernet 0/0

FastEthernet0/0 is up, line protocol is up
  Internet address is 192.168.1.1/24, Area 0
  Process ID 1, Router ID 11.11.11.11, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State WAITING, 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
    No Hellos (Passive interface)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
R1#

No Hellos (Passive interface)

  • Issue the show ip route command on R2 and R3 to verify that a route to the 192.168.1.0/24 network is still available.

R2#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, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
O    192.168.1.0/24 [110/65] via 192.168.12.1, 00:39:39, Serial0/0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
O    192.168.3.0/24 [110/65] via 192.168.23.2, 00:59:54, Serial0/1/0
     192.168.12.0/30 is subnetted, 1 subnets
C       192.168.12.0 is directly connected, Serial0/0/0
     192.168.13.0/30 is subnetted, 1 subnets
O       192.168.13.0 [110/128] via 192.168.12.1, 00:39:39, Serial0/0/0
                     [110/128] via 192.168.23.2, 00:39:39, Serial0/1/0
     192.168.23.0/30 is subnetted, 1 subnets
C       192.168.23.0 is directly connected, Serial0/1/0
R2#
R3#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, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
O    192.168.1.0/24 [110/65] via 192.168.13.1, 00:41:10, Serial0/0/0
O    192.168.2.0/24 [110/65] via 192.168.23.1, 00:41:10, Serial0/1/0
C    192.168.3.0/24 is directly connected, FastEthernet0/0
     192.168.12.0/30 is subnetted, 1 subnets
O       192.168.12.0 [110/128] via 192.168.13.1, 00:41:10, Serial0/0/0
                     [110/128] via 192.168.23.1, 00:41:10, Serial0/1/0
     192.168.13.0/30 is subnetted, 1 subnets
C       192.168.13.0 is directly connected, Serial0/0/0
     192.168.23.0/30 is subnetted, 1 subnets
C       192.168.23.0 is directly connected, Serial0/1/0
R3#

Step 13: Change OSPF Metrics

The default reference-bandwidth for OSPF is 100Mb/s (Fast Ethernet speed).

However, most modern infrastructure devices have links that are faster than 100Mb/s.

Because the OSPF cost metric must be an integer, all links with transmission speeds of 100Mb/s or higher have a cost of 1.

This results in Fast Ethernet, Gigabit Ethernet and 10G Ethernet interfaces all having the same cost.

Therefore, the reference-bandwidth must be changed to a higher value to accommodate networks with links faster that 100Mb/s.

  • Issue the show interface command on R1 to view the default bandwidth setting for the fa0/0 interface.

R1#show interfaces fa0/0
FastEthernet0/0 is up, line protocol is up (connected)
  Hardware is Lance, address is 0030.f2cc.7c87 (bia 0030.f2cc.7c87)
  Description: LINK_2_LAN
  Internet address is 192.168.1.1/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  ARP type: ARPA, ARP Timeout 04:00:00, 
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     8 packets input, 1024 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     357 packets output, 23232 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
R1# 
  • Issue the show ip route ospf command on R1 to determine the route to the 192.168.3.0/24 network.

R1#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, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

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
C    192.168.1.0/24 is directly connected, FastEthernet0/0
O    192.168.2.0/24 [110/65] via 192.168.12.2, 00:41:22, Serial0/0/0
O    192.168.3.0/24 [110/65] via 192.168.13.2, 00:41:22, Serial0/1/0
     192.168.12.0/30 is subnetted, 1 subnets
C       192.168.12.0 is directly connected, Serial0/0/0
     192.168.13.0/30 is subnetted, 1 subnets
C       192.168.13.0 is directly connected, Serial0/1/0
     192.168.23.0/30 is subnetted, 1 subnets
O       192.168.23.0 [110/128] via 192.168.12.2, 00:41:22, Serial0/0/0
                     [110/128] via 192.168.13.2, 00:41:22, Serial0/1/0
R1#

The accumulated cost to the 192.168.3.0/24 network from R1 is 65.

  • Issue the show ip ospf interface command on R3 to determine the routing cost for fa0/0.

R3>show ip ospf interface 

[...]
  Internet address is 192.168.3.1/24, Area 0
  Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 1
[...]  
  • Issue the show ip ospf interface s0/1/0 command on R1 to view the routing cost for S0/1/0.

R2#show ip ospf interface s0/1/0

[...]
  Internet address is 192.168.23.1/30, Area 0
  Process ID 1, Router ID 2.2.2.2, Network Type POINT-TO-POINT, Cost: 64

[...]  

The sum of the costs of these two interfaces is the accumulated cost for the route to the 192.168.3.0/24 network on R3 (1 + 64 = 65), as can be seen in the output from the show ip route command.

  • Issue the auto-cost reference-bandwidth 10000 command on R1 to change the default reference bandwidth setting.

R1(config)#router ospf 1
R1(config-router)#auto-cost reference-bandwidth 10000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent across all routers.
R1(config-router)#

With this setting :

  • 10Gb/s interfaces will have a cost of 1

  • 1 Gb/s interfaces will have a cost of 10

  • 100Mb/s interfaces will have a cost of 100

  • Issue the auto-cost reference-bandwidth 10000 command on routers R2 and R3.

R2(config)#router ospf 1
R2(config-router)#auto-cost reference-bandwidth 10000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent across all routers.
R2(config-router)#
R3(config)#router ospf 1
R3(config-router)#auto-cost reference-bandwidth 10000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent across all routers.
R3(config-router)#

Step 14: Change the bandwidth for an interface.

  • Issue the show interface s0/0/0 command on R1 to view the current bandwidth setting on S0/0/0.

R1#show interfaces s0/0/0
Serial0/0/0 is up, line protocol is up (connected)
  Hardware is HD64570
  Description: LINK_2_R2
  Internet address is 192.168.12.1/30
  MTU 1500 bytes, BW 128 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, loopback not set, keepalive set (10 sec)
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0 (size/max/drops); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations  0/0/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 96 kilobits/sec
  5 minute input rate 54 bits/sec, 0 packets/sec
  5 minute output rate 59 bits/sec, 0 packets/sec
     1376 packets input, 96168 bytes, 0 no buffer
     Received 4 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     1345 packets output, 93068 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up
R1#
  • Issue the show ip route ospf command on R1 to view the accumulated cost for the route to network 192.168.23.0/24 using S0/0/0. Note that there are two equal-cost (12952) routes to the 192.168.23.0/24 network, one via S0/0/0 and one via S0/1/0.

R1#show ip route 

[ ... ]
O       192.168.23.0 [110/12952] via 192.168.13.2, 01:02:03, Serial0/1/0
                     [110/12952] via 192.168.12.2, 01:02:03, Serial0/0/0
R1#
  • Issue the bandwidth 64 command to set the bandwidth on S0/0/0 to 64Kb/s.

R1(config)#interface s0/0/0
R1(config-if)#bandwidth ?
  <1-10000000>  Bandwidth in kilobits
R1(config-if)#bandwidth 64
  • Re-issue the show ip route ospf command. The routing table no longer displays the route to the 192.168.23.0/24 network over the S0/0/0 interface. This is because the best route, the one with the lowest cost, is now via S0/1/0.

R1#show ip route 

[ ... ]
     192.168.23.0/30 is subnetted, 1 subnets
O       192.168.23.0 [110/128] via 192.168.13.2, 00:03:05, Serial0/1/0
R1#

Keywords

yaser rahmati , routing protocol , یاسر رحمتی , ospf , process id , OSPF neighbor , routing information , show ip ospf neighbor , show ip protocols , OSPF process ID , Router ID , administrative distance , show ip ospf interface brief , kelaspar.ir , end-to-end connectivity , ping , loopback , loopback interface , clear ip ospf process , gateway , router-id , show ip ospf neighbor , Passive Interfaces , ospf metric , metric , cost , cost metric , auto-cost reference-bandwidth , lowest cost

Last updated