Config Lab: OSPF Interface Config 2
It’s too easy – enabling OSPF per interface rather than using the old IOS network command. In some ways, we may not trust that it’s that easy. So get some practice with today’s lab, a nice clean set of OSPF requirements including the use of interface commands to enable OSPF.
The Lab Exercise
Requirements
Configure OSPF for the lab network shown in the figure. However, do not use the traditional configuration with network commands in OSPF configuration mode. Instead, use OSPF interface configuration.
The specific rules for this lab are:
- Configure so each router uses a router-id of x.x.x.x where x equals the router number.
- Do not rely on interface IP addresses for the setting of the router IDs.
- Use OSPF area 0
- Use an OSPF process-id number of 50
- Enable OSPF directly on each interface, rather than using the indirect method and the OSPF network
- Assume all interfaces shown in the lab are up and working
Figure 1: Two Routers with IP Subnets
Initial Configuration
Examples 1 and 2 show the beginning configuration state of R1 and R2.
hostname R1
!
interface GigabitEthernet0/1
no shutdown
ip address 10.50.100.97 255.255.255.224
!
interface GigabitEthernet0/2
no shutdown
ip address 10.50.100.129 255.255.255.224
Example 1: R1 Config
hostname R2
!
interface GigabitEthernet0/1
no shutdown
ip address 10.50.100.98 255.255.255.224
!
interface GigabitEthernet0/2
no shutdown
ip address 10.50.101.1 255.255.255.224
Example 2: R2 Config
Answer Options - Click Tabs to Reveal
You can learn a lot and strengthen real learning of the topics by creating the configuration – even without a router or switch CLI. In fact, these labs were originally built to be used solely as a paper exercise!
To answer, just think about the lab. Refer to your primary learning material for CCNA, your notes, and create the configuration on paper or in a text editor. Then check your answer versus the answer post, which is linked at the bottom of the lab, just above the comments section.
You can also implement the lab using the Cisco Packet Tracer network simulator. With this option, you use Cisco’s free Packet Tracer simulator. You open a file that begins with the initial configuration already loaded. Then you implement your configuration and test to determine if it met the requirements of the lab.
(Use this link for more information about Cisco Packet Tracer.)
Use this workflow to do the labs in Cisco Packet Tracer:
- Download the .pkt file linked below.
- Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
- Add your planned configuration to the lab.
- Test the configuration using some of the suggestions below.
You can also implement the lab using Cisco Modeling Labs – Personal (CML-P). CML-P (or simply CML) replaced Cisco Virtual Internet Routing Lab (VIRL) software in 2020, in effect serving as VIRL Version 2.
If you prefer to use CML, use a similar workflow as you would use if using Cisco Packet Tracer, as follows:
- Download the CML file (filetype .yaml) linked below.
- Import the lab’s CML file into CML and then start the lab.
- Compare the lab topology and interface IDs to this lab, as they may differ (more detail below).
- Add your planned configuration to the lab.
- Test the configuration using some of the suggestions below.
Download this lab’s CML file!
Network Device Info:
The CML topology matches the lab topology.
Lab Answers Below: Spoiler Alert
Lab Answers: Configuration (Click Tab to Reveal)
Answers
Figure 1: Two Routers with IP Subnets
interface GigabitEthernet0/1
ip ospf 50 area 0
!
interface GigabitEthernet0/2
ip ospf 50 area 0
!
router ospf 50
router-id 1.1.1.1
Example 3: R1 Config
interface GigabitEthernet0/1
ip ospf 50 area 0
!
interface GigabitEthernet0/2
ip ospf 50 area 0
!
router ospf 50
router-id 2.2.2.2
Example 4: R2 Config
Commentary, Issues, and Verification Tips (Click Tabs to Reveal)
Commentary
The legacy method of configuring OSPF uses network statements inside of OSPF router configuration mode. The network command causes the OSPF process to match the interfaces that will be included into the OSPF area specified. The alternative is to use commands inside interface configuration mode to specify that it will be included inside the OSPF area specified. This newer interface method is considered by many to be easier and a more readable configuration method.
For this lab each of the routers will be configured with an OSPF process ID of 50 (this is a locally significant number only). R1 will be configured with a router-id of 1.1.1.1 and R2 will be configured with a router-id of 2.2.2.2 using the router-id command. This command is still located under OSPF router configuration mode even when using interface configuration commands to specify the included OSPF interfaces.
Note the absence of network commands under the router ospf commands.
Individual ip ospf process-id area area-id interface subcommands replace the network command’s purpose. Each of these commands enables the OSPF process listed by number. Because this lab asked you to use process ID 50 on both routers, and to put all interfaces in area 0, the answers show the command ip ospf 50 area 0 throughout the configuration, one per router interface.
Known Issues in this Lab
This section of each Config Lab Answers post hopes to help with those issues by listing any known issues with Packet Tracer related to this lab. In this case, the issues are:
# | Summary | Detail |
1 | None | No known issues related to this lab. |
Why Would Cisco Packet Tracer Have Issues?
(Note: The below text is the same in every Config Lab.)
Cisco Packet Tracer (CPT) simulates Cisco routers and switches. However, CPT does not run the same software that runs in real Cisco routers and switches. Instead, developers wrote CPT to predict the output a real router or switch would display given the same topology and configuration – but without performing all the same tasks, an actual device has to do. On a positive note, CPT requires far less CPU and RAM than a lab full of devices so that you can run CPT on your computer as an app. In addition, simulators like CPT help you learn about the Cisco router/switch user interface – the Command Line Interface (CLI) – without having to own real devices.
CPT can have issues compared to real devices because CPT does not run the same software as Cisco devices. CPT does not support all commands or parameters of a command. CPT may supply output from a command that differs in some ways from what an actual device would give. Those differences can be a problem for anyone learning networking technology because you may not have experience with that technology on real gear – so you may not notice the differences. So this section lists differences and issues that we have seen when using CPT to do this lab.
Beyond comparing your answers to this lab’s Answers post, you can test in Cisco Packet Tracer (CPT) or Cisco Modeling Labs (CML). In fact, you can and should explore the lab once configured. For this lab, once you have completed the configuration, try these verification steps.Â
- Each router should have one OSPF neighbor; verify that fact with the show ip ospf neighbor command.
- Each router should list one OSPF-learned route, which you can verify with the show ip route command. (If you view the links between routers as a WAN link, the OSPF route will be for the remote LAN.)
- Verify which interfaces are enabled for OSPF with the show ip ospf interface brief command.
- Verify the OSPF router ID with the show ip ospf database command.
Why the verification tips mentions that each router would have “two” neighbors while the total router quantity is two nos ? Doesn’t it mean to have one neighbor for each ?
Secondly while checking the out of “show ip interface brief” or both the routers , it correctly indicates DR and BDR states but “Nbrs F/C” indicates 0/0 for both routers. should it not be 1/1 instead ?
Hi True,
On #1, the verification tips were wrong. I think that when I created this post, I copied those notes from a similar lab, and didn’t update that part of the post. It’s updated now. Sorry about the misdirection, but thanks for letting me know.
On #2, yes, looks like an issue with the accuracy of the PT implementation of the “show ip ospf interface brief” command. That command lists “Nbrs F/C” as 0/0, when a real device would list 1/1 in this case. The “show ip ospf interface” command confirms the correct numbers in PT with this line:
Neighbor Count is 1, Adjacent neighbor count is 1
Thanks much,
Wendell
Thank you very much Wendell for your clarifications.
You’re quite welcome!
Wendell
I did this lab perfectly in CPT but ran into issues on R2 not seeing the 10.50.100.129/27 network being advertised on R1 until power cycling the devices. Very strange.
Hi Gabriel,
I’ve seen enough issues w/ OSPF in CPT that I just go ahead and copy run start and reload if there’s any question that it’s not working right… FYI.