In this part, you will implement single-area OSPF on a multiaccess Ethernet network.
OSPF can be enabled using the traditional network router config command and wildcard mask. The wildcard mask enables the configuration to be as specific or vague as necessary. For example:
· network ip-address 0.0.0.0 area area-id – Configuring the network statement with an IP address explicitly enables OSPF on that interface.
· network network wildcard-mask area area-id – The wildcard mask can explicitly match a subnet, or it can be less specific to match several subnets as required.
· network 0.0.0.0 255.255.255.255 area area-id – This is the vaguest method as the 0.0.0.0 network with 255.255.255.255 wildcard mask matches all enabled interfaces.
An alternate method to using the network router configuration command is to use the interface specific method. Instead of the network statement, an interface is enabled for OSPF using the ip ospf process-id area area-id interface configuration command. Although simpler to use, the disadvantage is that the configuration is not centralized and increases in complexity as the number of interfaces on the routers increases.
Note: There is a newer method to configure OSPF using address families. Address families are covered in OSPFv3 and in CCNP Enterprise: Advanced Routing.
D1 will advertise its OSPF networks using the OSPF network ip-address 0.0.0.0 area area-id command method and quad-zero wildcard mask. This enables OSPF for Area 0 only on the interfaces that explicitly match the IP addresses configured.
a. Layer 3 switches are not enabled to perform routing by default. Therefore, routing must be enabled using the ip routing global configuration command.
Open configuration window
D1(config)# ip routing |
b. Next, enter the OSPF router configuration mode using process ID 123.
D1(config)# router ospf 123 |
c. When using the quad-zero method, it is not necessary to calculate the actual wildcard mask. You simply advertise the IP address of the interface with a quad-zero wildcard mask and OSPF will advertise using the subnet mask of the interface. Configure OSPF to advertise the network address of the G0/1 interface (i.e., 10.10.0.2) with the quad-zero mask.
D1(config-router)# network 10.10.0.2 0.0.0.0 area 0 |
d. Next, enable OSPF on the G0/0 and G0/2 interfaces using a quad-zero mask.
D1(config-router)# network 10.10.8.1 0.0.0.0 area 0 D1(config-router)# network 10.10.9.1 0.0.0.0 area 0 |
These networks are now being advertised to other OSPF routers.
e. Verify the OSPF configuration on D1 using the show ip protocols command.
D1# show ip protocols *** IP Routing is NSF aware ***
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 10.10.9.1 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: 10.10.0.2 0.0.0.0 area 0 10.10.8.1 0.0.0.0 area 0 10.10.9.1 0.0.0.0 area 0 Routing Information Sources: Gateway Distance Last Update Distance: (default is 110) |
The OSPF router ID chosen was the highest active IPv4 address configured on D1. The Routing for Networks section in the output above confirms that the configured statements are accurately advertising the D1 networks.
Close configuration window
D2 will advertise its OSPF networks using the network router configuration command and wildcard masks.
a. Like D1, D2 must be enabled for routing using the ip routing global configuration command.
Open configuration window
D2(config)# ip routing |
b. Next, enter the OSPF router configuration mode using process ID 123. Note that process IDs are only locally significant. Therefore, the process ID of other OSPF routers do not need to match. However, using the same process ID makes it simpler to remember and reduces potential configuration mistakes.
D2(config)# router ospf 123 |
c. Configure D2 to advertise the G0/2 /29 interface in OSPF area 0. The wildcard mask can be calculated using by deducting the subnet mask (i.e., /29 = 255.255.255.248) from 255.255.255.255, resulting in a wildcard mask of 0.0.0.7.
D2(config-router)# network 10.10.0.0 0.0.0.7 area 0 D2(config-router)# *Mar 1 00:16:46.465: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.9.1 on GigabitEthernet1/0/5 from LOADING to FULL, Loading Done |
Notice the informational message confirming that D2 has established a neighbor relationship with D1 (i.e., 10.10.9.1).
d. Next, configure D2 to advertise the two /24 networks in OSPF area 0. This can be accomplished using two network statements with specific wildcard mask for each subnet.
D2(config-router)# network 10.10.24.0 0.0.0.255 area 0 D2(config-router)# network 10.10.25.0 0.0.0.255 area 0 |
Note: The two networks could also be enabled using the network 10.10.24.0 0.0.254.255 statement instead.
There are no informational messages this time because these interfaces are not connected to other OSPF-enabled routers. However, these networks are now being advertised to other OSPF routers.
e. Verify the OSPF configuration on D2 using the show ip protocols command.
D2# show ip protocols *** IP Routing is NSF aware ***
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 10.10.25.1 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: 10.10.0.0 0.0.0.7 area 0 10.10.24.0 0.0.0.255 area 0 10.10.25.0 0.0.0.255 area 0 Routing on Interfaces Configured Explicitly (Area 0):
Routing Information Sources: Gateway Distance Last Update 10.10.9.1 110 00:11:05 Distance: (default is 110) |
Again, the OSPF router ID chosen was the highest active IPv4 address configured on D2. The Routing for Networks section confirms that the configured statements are accurately advertising the D2 networks. We now also have another routing information source, 10.10.9.1 (i.e., D1).
R1 will use the OSPF interface specific method to advertise the Lo1 interface and the G0/0 interface. Interface Lo0 will be advertised in Part 3. The interface specific method is simple because there is no need to enter network statements or calculate wildcard masks. You simply enter the ip ospf process-id area area-id interface configuration command on an interface.
Note: Alternatively, the network 0.0.0.0 255.255.255.255 area 0 router configuration command would be simpler. However, it would enable OSPF on all interfaces including the Lo0 interface that will be advertised in Part 3.
a. The loopback interface on R1 is only configured to simulate another network for OSPF to advertise. However, the default behavior of OSPF for loopback interfaces is to advertise a 32-bit host route. To ensure that the /26 network is advertised, the ip ospf network point-to-point interface command must be configured on the loopback 1 interface. Change the network type on the loopback interfaces so that they are advertised with the correct subnet.
Open configuration window
R1(config)# interface loopback 1 R1(config-if)# ip ospf network point-to-point |
b. Next enable the loopback interface for OSPF using the ip ospf 123 area 0 command as shown.
R1(config-if)# ip ospf 123 area 0 R1(config-if)# exit |
c. Enter interface G0/0/1 and enable it for OSPF.
R1(config)# interface g0/0 R1(config-if)# ip ospf 123 area 0 R1(config-if)# end R1# R1# *Dec 22 18:32:48.873: %OSPF-6-DFT_OPT: Protocol timers for fast convergence are Enabled. R1# *Dec 22 18:32:49.683: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.9.1 on GigabitEthernet0/0/1 from LOADING to FULL, Loading Done *Dec 22 18:32:49.683: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.25.1 on GigabitEthernet0/0/1 from LOADING to FULL, Loading Done *Dec 22 18:32:49.755: %SYS-5-CONFIG_I: Configured from console by console |
Notice how the informational messages are confirming that neighbor adjacencies have been established with D1 (i.e., 10.10.9.1) and D2 (i.e., 10.10.25.1).
d. Verify the OSPF configuration on R1 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 209.165.200.225 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 Routing Information Sources: Gateway Distance Last Update 10.10.9.1 110 00:03:47 10.10.25.1 110 00:03:47 Distance: (default is 110) |
Again, the router ID chosen is the highest active IPv4 loopback address configured on R1. The Routing for Networks section confirms that routing was explicitly configured on the interfaces. It also displays a new routing source; 10.10.25.1.
The OSPF router ID is dynamically assigned in order of preference:
· Manually configured using the router-id router-id router configuration command.
· If it is not manually assigned, then the highest enabled loopback IP address is used as the router ID.
· If there are no loopback interfaces configured, then the highest IP address of any active physical interfaces in the up state becomes the RID when the OSPF process initializes.
It is best to assign a static OSPF router ID for troubleshooting purposes.
To force an existing OSPF network to use the new router IP, the OSPF process must be reset using the clear ip ospf process privileged EXEC command.
a. Assign R1 the router ID 1.1.1.1 as shown.
Open configuration window
R1(config)# router ospf 123 R1(config-router)# router-id 1.1.1.1 % OSPF: Reload or use “clear ip ospf process” command, for this to take effect R1(config-router)# end |
b. Next clear the OSPF process as shown.
R1# clear ip ospf process Reset ALL OSPF processes? [no]: yes R1# *Dec 22 19:10:30.681: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.9.1 on GigabitEthernet0/0/1 from FULL to DOWN, Neighbor Down: Interface down or detached *Dec 22 19:10:30.681: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.25.1 on GigabitEthernet0/0/1 from FULL to DOWN, Neighbor Down: Interface down or detached *Dec 22 19:10:30.692: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.9.1 on GigabitEthernet0/0/1 from LOADING to FULL, Loading Done *Dec 22 19:10:30.692: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.25.1 on GigabitEthernet0/0/1 from LOADING to FULL, Loading Done |
c. Confirm that R1 is now using the new router ID as shown.
R1# show ip protocol | include Router ID Router ID 1.1.1.1 |
d. Repeat the process on D1 and D2. Use router ID 2.2.2.2 for D1 and 3.3.3.3 for D2. Also confirm that D1 and D2 are using the new router ID.
D1(config)# router ospf 123 D1(config-router)# router-id 2.2.2.2 Reload or use “clear ip ospf process” command, for this to take effect D1(config-router)# end D1# *Mar 1 01:34:59.983: %SYS-5-CONFIG_I: Configured from console by console D1# D1# clear ip ospf process Reset ALL OSPF processes? [no]: y D1# *Mar 1 01:35:13.254: %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 01:35:13.254: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.25.1 on GigabitEthernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached *Mar 1 01:35:13.279: %OSPF-5-ADJCHG: Process 123, Nbr 10.10.25.1 on GigabitEthernet0/1 from LOADING to FULL, Loading Done *Mar 1 01:35:55.121: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/1 from LOADING to FULL, Loading Done
D1# show ip protocol | include Router ID Router ID 2.2.2.2 |
D2(config)# router ospf 123 D2(config-router)# router-id 3.3.3.3 Reload or use “clear ip ospf process” command, for this to take effect D2(config-router)# end D2# *Mar 1 01:38:22.081: %SYS-5-CONFIG_I: Configured from console by console D2# D2# clear ip ospf process Reset ALL OSPF processes? [no]: y D2# *Mar 1 01:38:29.673: %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 01:38:29.673: %OSPF-5-ADJCHG: Process 123, Nbr 2.2.2.2 on GigabitEthernet0/2 from FULL to DOWN, Neighbor Down: Interface down or detached *Mar 1 01:38:29.690: %OSPF-5-ADJCHG: Process 123, Nbr 2.2.2.2 on GigabitEthernet0/2 from LOADING to FULL, Loading Done *Mar 1 01:39:10.433: %OSPF-5-ADJCHG: Process 123, Nbr 1.1.1.1 on GigabitEthernet0/2 from LOADING to FULL, Loading Done
D2# show ip protocols | include Router ID Router ID 3.3.3.3 |
It is imperative to know how to validate that OSPF is operating as configured. The show running-config command only displays the initial OSPF configuration. It does not validate the operation and functionality of OSPF.
Along with the show ip protocols command, there are several other useful OSPF-related show commands to verify that OSPF is operating as expected.
a. The show ip route ospf privileged EXEC command is used to verify the operation of OSPF. The command displays OSPF routes learned with an O, the administrative distance, the assigned metric, the next-hop IP address, and the local exit interface to reach the network.
Open configuration window
R1# show ip route ospf | begin Gateway Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks O 10.10.8.0/24 [110/2] via 10.10.0.2, 00:14:49, GigabitEthernet0/0 O 10.10.9.0/24 [110/2] via 10.10.0.2, 00:14:49, GigabitEthernet0/0 O 10.10.24.0/24 [110/2] via 10.10.0.3, 00:14:49, GigabitEthernet0/0 O 10.10.25.0/24 [110/2] via 10.10.0.3, 00:14:49, GigabitEthernet0/0 |
D1# show ip route ospf | begin Gateway Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O 10.10.24.0/24 [110/2] via 10.10.0.3, 00:15:54, GigabitEthernet0/1 O 10.10.25.0/24 [110/2] via 10.10.0.3, 00:15:54, GigabitEthernet0/1 192.168.1.0/26 is subnetted, 1 subnets O 192.168.1.0 [110/2] via 10.10.0.1, 00:15:54, GigabitEthernet0/1 |
D2# show ip route ospf | begin Gateway Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks O 10.10.8.0/24 [110/2] via 10.10.0.2, 00:16:32, GigabitEthernet0/2 O 10.10.9.0/24 [110/2] via 10.10.0.2, 00:16:32, GigabitEthernet0/2 192.168.1.0/26 is subnetted, 1 subnets O 192.168.1.0 [110/2] via 10.10.0.1, 00:16:32, GigabitEthernet0/2 |
b. Use the show ip ospf interface [brief] command to verify which interfaces are enabled for OSPF, process ID, Area ID, and state. A missing interface could be the result of an incorrect network statement, IP addressing problem, or a disabled interface.
R1# show ip ospf interface brief Interface PID Area IP Address/Mask Cost State Nbrs F/C Lo1 123 0 192.168.1.1/26 1 P2P 0/0 Gi0/0 123 0 10.10.0.1/29 1 DROTH 2/2
D1# show ip ospf interface brief Interface PID Area IP Address/Mask Cost State Nbrs F/C Gi0/2 123 0 10.10.9.1/24 1 DR 0/0 Gi0/0 123 0 10.10.8.1/24 1 DR 0/0 Gi0/1 123 0 10.10.0.2/29 1 DR 2/2
D2# show ip ospf interface brief Interface PID Area IP Address/Mask Cost State Nbrs F/C Gi0/0 123 0 10.10.24.1/24 1 DR 0/0 Gi0/1 123 0 10.10.25.1/24 1 DR 0/0 Gi0/2 123 0 10.10.0.3/29 1 BDR 2/2 |
Note: Omitting the “brief” keyword displays detailed information about the OSPF enabled interfaces.
This State field defines the state of the link and can be:
DR – This is the Designated Router on the multiaccess network (i.e., Ethernet) to which this interface is connected. The DR establishes OSPF adjacencies with all other routers on the network.
BDR – This is the Backup Designated Router on the multiaccess network to which this interface is connected. Like the DR, the BDR establishes adjacencies with all other routers on the broadcast network.
DROTH – This is a DROTHER. It is neither the DR nor the BDR on the multiaccess network. All non-DRs and BDRs on the broadcast network would be DROTHERs and establish adjacencies only with the DR and the BDR.
P2P – This is an OSPF point-to-point interface and does not require a DR or BDR. In this state, the interface is fully functional and starts exchanging hello packets with all of its neighbors.
c. Use the show ip ospf neighbor [detail] command to verify which OSPF neighbor your device has established adjacencies with, the state, the next-hop IP address, and the exit interface to use. A neighbor may not be appearing include RIDs that are not unique, interconnecting interfaces that are not on a common subnet, MTU values that do not match, Area ID that is not correct, Hello and dead interval timers that do not match, or authentication type / credentials that do not match. The following output confirms that our devices have correctly established adjacencies. The output for R1 is shown below. Repeat the command for D1 and D2.
R1# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/DR 00:00:33 10.10.0.2 GigabitEthernet0/0 3.3.3.3 1 FULL/BDR 00:00:37 10.10.0.3 GigabitEthernet0/0
D1# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 1 FULL/DROTHER 00:00:32 10.10.0.1 GigabitEthernet0/1 3.3.3.3 1 FULL/DR 00:00:34 10.10.0.3 GigabitEthernet0/1
D2# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 1 FULL/DROTHER 00:00:31 10.10.0.1 GigabitEthernet0/2 2.2.2.2 1 FULL/BDR 00:00:39 10.10.0.2 GigabitEthernet0/2 |
d. Other OSPF validation commands include the show ip ospf, show ip ospf topology-info, show ip ospf database commands. Use these commands now and identify what types of information they generate which may be useful to know when troubleshooting a network.