In this part, you will configure OSPF optimizing features including:
Passive interfaces
Link costs
Reference bandwidth
Hello and Dead interval timers
A passive interface does not send out OSPF messages or process any received OSPF packets. However, the passive interface network segment is still added to the link state database (LSDB) and advertised out of non-passive interfaces. For security reasons, LAN interfaces which are not connected to other OSPF routers should be passive.
There are two approaches to identify passive interfaces.
Use the passive-interface interface-id router configuration command to make an interface passive. This is a good approach to use when there are only a few interfaces to make passive.
Use the passive-interface default router config command to make all interfaces passive, and then make some interfaces not passive using the no passive-interface interface-id command. This is a good approach to use when there are many interfaces to make passive, but only a few interfaces that should not be passive.
a. R1 only needs the Lo1 interface to be passive. The first approach is used to make the Loopback 1 interface passive. Enter OSPF router configuration mode and make the Lo1 interface passive as shown.
Open configuration window
R1(config-if)# router ospf 123 R1(config-router)# passive-interface lo1 R1(config-router)# end |
b. Verify which interfaces are passive using the show ip protocols command.
R1# show ip protocols | section ospf Routing Protocol is “ospf 123” 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 It is an autonomous system boundary router Redistributing External Routes from, Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: Routing on Interfaces Configured Explicitly (Area 0): Loopback1 GigabitEthernet0/0/1 Passive Interface(s): Loopback1 Loopback1 Routing Information Sources: Gateway Distance Last Update 3.3.3.3 110 10:45:59 2.2.2.2 110 10:45:59 10.10.9.1 110 10:54:49 10.10.25.1 110 10:49:26 Distance: (default is 110) |
c. A Layer 3 switch can potentially have many interfaces that should be passive. For example, assume that D1 and D2 only require their G0/1 and G0/2 interfaces to not be passive. However, all other interfaces should be passive. Using the first approach would be very time-consuming. For this reason, the second approach will be used. All active interfaces will be rendered passive and only interface G0/1 will be re-enabled.
D1(config)# router ospf 123 D1(config-router)# passive-interface default D1(config-router)# *Mar 1 12:30:42.637: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached *Mar 1 12:30:42.637: %OSPF-5-ADJCHG: Process 123, Nbr 3.3.3.3 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached
D1(config-router)# no passive-interface g0/1 D1(config-router)# *Mar 1 12:31:35.880: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/1 from LOADING to FULL, Loading Done D1(config-router)# *Mar 1 12:31:39.445: %OSPF-5-ADJCHG: Process 123, Nbr 3.3.3.3 on GigabitEthernet0/1 from LOADING to FULL, Loading Done D1(config-router)# end |
Notice the information messages stating that the OSPF adjacency with R1 and D2 transitioned to the DOWN state. Disabling the passive feature on interface G1/0/5 re-enabled the OSPF adjacency.
d. Repeat the process on D2.
D2(config)# router ospf 123 D2(config-router)# passive-interface default D2(config-router)# *Mar 1 12:37:05.837: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/2 from FULL to DOWN, Neighbor Down: Interface down or detached *Mar 1 12:37:05.837: %OSPF-5-ADJCHG: Process 123, Nbr 2.2.2.2 on GigabitEthernet0/2 from FULL to DOWN, Neighbor Down: Interface down or detached
D2(config-router)# no passive-interface g0/2 D2(config-router)# *Mar 1 12:41:12.697: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/2 from LOADING to FULL, Loading Done *Mar 1 12:41:12.706: %OSPF-5-ADJCHG: Process 123, Nbr 2.2.2.2 on GigabitEthernet0/2 from LOADING to FULL, Loading Done D2(config-router)# end |
Close configuration window
The OSPF path metric is based on the cumulative interface cost to the network. OSPF assigns the OSPF link cost using the formula Cost = Reference Bandwidth / Interface Bandwidth. The default reference bandwidth is 100 Mbps, therefore, the default formula is Cost = 100,000,000/Interface Bandwidth. For example, a FastEthernet interface would be assigned a cost of 1 (i.e., 100,000,000 / 100,000,000).
However, the default reference bandwidth does not differentiate interfaces faster than FastEthernet. Therefore, OSPF assigns the identical cost of “1”to FastEthernet, Gigabit Ethernet, and 10 GE interfaces. OSPF makes no distinction that the Gig and 10GE interfaces are faster.
Use the auto-cost reference-bandwidth bandwidth-mbps router configuration command to change the reference bandwidth as follows:
· auto-cost reference-bandwidth 100 – Assigns the default reference bandwidth to 100 Mbps which is the default setting. With this setting, FastEthernet = 1, GigabitEthernet = 1, and 10GE = 1.
· auto-cost reference-bandwidth 1000 – Assigns the default reference bandwidth to 1 Gbps. With this setting, FastEthernet = 10, GigabitEthernet = 1, and 10GE = 1.
· auto-cost reference-bandwidth 10000 – Assigns the default reference bandwidth to 10 Gbps. With this setting, FastEthernet = 100, GigabitEthernet = 10, and 10GE = 1.
Note: The auto-cost reference-bandwidth must be the same on all routers in the area. Otherwise suboptimal routing may occur.
a. On R1, change the reference bandwidth to account for the Gigabit interfaces as shown.
Open configuration window
R1(config)# router ospf 123 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)# end |
b. Verify that the reference bandwidth has changed to account for the Gigabit interfaces using the show ip ospf command.
R1# show ip ospf | include Ref Reference bandwidth unit is 10000 mbps |
c. Repeat the steps on D1 and D2 to change the reference bandwidth to account for the Gigabit interfaces.
D1(config)# router ospf 123 D1(config-router)# auto-cost reference-bandwidth 10000 % OSPF: Reference bandwidth is changed. Please ensure reference bandwidth is consistent across all routers. D1(config-router)# end
D1# show ip ospf | include Ref Reference bandwidth unit is 10000 mbps |
D2(config)# router ospf 123 D2(config-router)# auto-cost reference-bandwidth 10000 % OSPF: Reference bandwidth is changed. Please ensure reference bandwidth is consistent across all routers. D2(config-router)# end
D2# show ip ospf | include Ref Reference bandwidth unit is 10000 mbps |
d. Verify the routing table on D2 to see if the route metrics have increased.
R1# show ip route ospf | begin Gateway Gateway of last resort is 0.0.0.0 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks O 10.10.8.0/24 [110/20] via 10.10.0.2, 00:05:57, GigabitEthernet0/0 O 10.10.9.0/24 [110/20] via 10.10.0.2, 00:05:57, GigabitEthernet0/0 O 10.10.24.0/24 [110/20] via 10.10.0.3, 00:03:31, GigabitEthernet0/0 O 10.10.25.0/24 [110/20] via 10.10.0.3, 00:03:31, GigabitEthernet0/0 |
D1# show ip route ospf | begin Gateway Gateway of last resort is 10.10.0.1 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 10.10.0.1, 00:02:48, GigabitEthernet0/1 10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O 10.10.24.0/24 [110/20] via 10.10.0.3, 00:02:48, GigabitEthernet0/1 O 10.10.25.0/24 [110/20] via 10.10.0.3, 00:02:48, GigabitEthernet0/1 192.168.1.0/26 is subnetted, 1 subnets O 192.168.1.0 [110/11] via 10.10.0.1, 00:02:48, GigabitEthernet0/1 |
D2# show ip route ospf | begin Gateway Gateway of last resort is 10.10.0.1 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 10.10.0.1, 00:00:10, GigabitEthernet0/2 10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O 10.10.8.0/24 [110/20] via 10.10.0.2, 00:00:10, GigabitEthernet0/2 O 10.10.9.0/24 [110/20] via 10.10.0.2, 00:00:10, GigabitEthernet0/2 192.168.1.0/26 is subnetted, 1 subnets O 192.168.1.0 [110/11] via 10.10.0.1, 00:00:10, GigabitEthernet0/2 |
Close configuration window
OSPF Hello messages are exchanged to establish a neighbor relationship and to ensure that adjacent OSPF neighbors are still available. OSPF uses a hello timer and a dead interval timer which is four times the hello timer.
When a router receives a Hello packet, the dead interval resets and starts to decrement again. If subsequent hello packets are not received before the OSPF dead interval timer reaches 0, the neighbor state is changed to down. The router then sends out the appropriate topology change LSA to all other peers and the SPF algorithm must be recalculated on all routers in the area.
The default OSPF hello timer interval varies based on the OSPF network type. On broadcast and point-to-point links, the default hello timer interval is 10 seconds and dead timer interval is 40 seconds. On non-broadcast multiaccess (NBMA) and point-to-multipoint networks, the default hello interval is 30 seconds with a dead timer interval of 120 seconds.
You can alter the hello timer interval with values between 1 and 65,535 seconds using the ip ospf hello-interval seconds interface configuration command.
The dead interval can be modified using the ip ospf dead-interval seconds interface configuration command. However, the command is really not required because changing the hello timer interval automatically modifies the default dead interval.
a. On R1, change the hello interval on the G0/0/1 interface to 5 seconds and a dead interval time to 20 seconds.
Open configuration window
R1(config)# interface g0/0 R1(config-if)# ip ospf hello-interval 5 R1(config-if)# ip ospf dead-interval 20 R1(config-if)# end *Dec 23 08:52:07.961: %OSPF-5-ADJCHG: Process 123, Nbr 2.2.2.2 on GigabitEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired *Dec 23 08:52:30.471: %OSPF-5-ADJCHG: Process 123, Nbr 3.3.3.3 on GigabitEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired |
Notice how R1 has received OSPF adjacency change messages for D1 and D2. The reason is because OSPF timers must match between interconnecting peers. Therefore, the D1 and D2 GigabitEthernet0/1 and Gi0/2 interfaces must also be configured with the identical timers.
b. Verify that the timers have changed on G0/0/1 using the show ip ospf interface command.
R1# show ip ospf interface g0/0 | include Timer Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5 |
c. Configure D1 with the identical hello and dead interval timers on GigabitEthernet0/1 and verify.
*Mar 1 15:12:45.159: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Dead timer expired D1(config)# interface g0/1 D1(config-if)# ip ospf hello-interval 5 D1(config-if)# ip ospf dead-interval 20 D1(config-if)# *Mar 1 15:18:25.779: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/1 from LOADING to FULL, Loading Done D1(config-if)# end D1# *Mar 1 15:18:53.201: %OSPF-5-ADJCHG: Process 123, Nbr 3.3.3.3 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Dead timer expired |
D1# show ip ospf interface g0/1 | include Timer Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5 |
Notice the first OSPF adjacency change message indicating that D1 had lost adjacency with R1. After the commands are entered, the next OSPF adjacency change message indicates that the adjacency with R1 has been re-established. However, the second adjacency change message indicates that the adjacency with D2 has been lost because its timers are not matching.
Also notice that the dead interval was automatically adjusted without having to configure the ip ospf dead-interval 20 command on the interface.
d. Configure D2 with the identical hello and dead interval timers on GigabitEthernet0/2 and verify.
*Mar 1 15:12:34.045: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/2 from FULL to DOWN, Neighbor Down: Dead timer expired *Mar 1 15:19:24.717: %OSPF-5-ADJCHG: Process 123, Nbr 2.2.2.2 on GigabitEthernet0/2 from FULL to DOWN, Neighbor Down: Dead timer expired D2# D2# conf t D2(config)# interface g0/2 D2(config-if)# ip ospf hello-interval 5 D2(config-if)# ip ospf dead-interval 20 *Mar 1 15:38:48.158: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/2 from LOADING to FULL, Loading Done *Mar 1 15:38:52.965: %OSPF-5-ADJCHG: Process 123, Nbr 2.2.2.2 on GigabitEthernet0/2 from LOADING to FULL, Loading Done D2(config-if)# end |
D2# show ip ospf interface g0/2 | include Timer Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5 |
Close configuration window
Again, notice the existing OSPF adjacency change messages indicating that D2 had lost adjacency with R1 and D1.
After the commands are entered, the next OSPF adjacency change messages indicate adjacencies with R1 and D1 have been re-established. And again, the dead interval was automatically adjusted without having to configure the ip ospf dead-interval 20 command on the interface.