Config Lab: Multi-area OSPF 2
A router configuration can enable OSPF on an interface directly using the ip ospf interface subcommand. In fact, the configuration is more direct and obvious than the old traditional use of the OSPF network subcommand. This lab combines OSPF interface configuration with a multi-area OSPF design, with a little extra configuration related to OSPF router IDs thrown in for variety.
The Lab Exercise
Requirements
Configure multi-area OSPFv2 (that is, OSPF for IPv4) on the four routers shown in the figure. Use the area design shown in the figure. The configuration should use the interface subcommand ip ospf to enable OSPF on each interface, and should use no network commands in OSPF configuration mode. The specific rules for this lab are:
- Use an OSPF process-ID of 50 on all routers
- Use only ip ospf interface subcommands to enable OSPF on an interface
- Use the following OSPF router IDs, and make each router use the method listed below when the router chooses its router ID:
- Core1: 1.1.1.1 (explicitly configured)
- Core2: 2.2.2.2 (explicitly configured)
- Branch1: 172.30.99.1 (Based on interface loopback0 address of 172.30.99.1/32)
- Branch2: 172.30.99.2 (Based on interface loopback0 address of 172.30.99.2/32)
- Use all default OSPF parameters unless otherwise requested.
- Assume all device interfaces shown in the lab are up, working and with correct IP addresses assigned.
Figure 1: Multi-area OSPF Topology
Initial Configuration
Example 1, 2, 3 and 4 show the beginning configuration state of Core1, Core2, Branch1 and Branch2.
hostname Core1
!
interface GigabitEthernet0/1
 ip address 172.30.1.129 255.255.255.252
 no shutdown
!
interface GigabitEthernet0/2
 ip address 172.30.1.193 255.255.255.248
 no shutdown
Example 1: Core1 Config
hostname Core2
!
interface GigabitEthernet0/1
 ip address 172.30.1.130 255.255.255.252
 no shutdown
!
interface GigabitEthernet0/2
 ip address 172.30.1.201 255.255.255.248
 no shutdown
Example 2: Core2 Config
hostname Branch1
!
interface GigabitEthernet0/1
 ip address 172.30.1.194 255.255.255.248
 no shutdown
!
interface GigabitEthernet0/2
 ip address 172.30.1.1 255.255.255.192
 no shutdown
Example 3: Branch1 Config
hostname Branch2
!
interface GigabitEthernet0/1
 ip address 172.30.1.202 255.255.255.248
 no shutdown
!
interface GigabitEthernet0/2
 ip address 172.30.1.65 255.255.255.192
 no shutdown
Example 4: Branch2 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: Multi-area OSPF Topology
router ospf 50
 router-id 1.1.1.1
!
interface GigabitEthernet0/1
 ip ospf 50 area 0
!
interface GigabitEthernet0/2
 ip ospf 50 area 10
Example 1: Core1 Config
router ospf 50
 router-id 2.2.2.2
!
interface GigabitEthernet0/1
 ip ospf 50 area 0
!
interface GigabitEthernet0/2
 ip ospf 50 area 20
Example 2: Core2 Config
interface loopback 0
 ip address 172.30.99.1 255.255.255.255
!
router ospf 50
!
interface GigabitEthernet0/1
 ip ospf 50 area 10
!
interface GigabitEthernet0/2
 ip ospf 50 area 10
Example 3: Branch1 Config
interface loopback 0
 ip address 172.30.99.2 255.255.255.255
!
router ospf 50
!
interface GigabitEthernet0/1
 ip ospf 50 area 20
!
interface GigabitEthernet0/2
 ip ospf 50 area 20
Example 4: Branch2 Config
Commentary, Issues, and Verification Tips (Click Tabs to Reveal)
Commentary
For this lab you are tasked with configuring the four different routers with OSPF and placing each of the interfaces into their respective areas by using ip ospf interface subcommands. This style of OSPF configuration can be simple to configure, especially if you have good documentation about router interfaces and areas. This lab supplies a figure with the routers, interface numbers, and areas. For about half of the requirements of this lab, all you have to do is issue a command like ip ospf 50 area 0 or similar under each interface.
Work through examples 1 through 4, focusing on only the ip ospf commands under each interface. Compare those commands to Figure 1. You should see the ip ospf 50 area 0 command on both Core1 and Core 2, under the interfaces that connect Core1 and Core2. This command references each router’s local process ID (50), and the area number into which to put that link. Continuing through the various examples:
- Router Branch1 uses the same ip ospf 50 area 10Â command on both interfaces, enabling OSPF process 50 on both, and placing both in area 10.
- Router Branch2 uses the same ip ospf 50 area 20Â command on both interfaces, enabling OSPF process 50 on both, and placing both in area 20.
- Router Core1 uses the ip ospf 50 area 10Â command on its G0/2 interface (which connects to router Branch1), placing that link into area 10.
- Router Core2 uses the ip ospf 50 area 20 command on its G0/2 interface (which connects to router Branch1), placing that link into area 20.
As for the routers’ process IDs, the lab asks that all routers use process ID 50. Note that all show the router ospf 50 command as a result.
Finally, on the topic of OSPF router IDs (RIDs), the requirements asked you to explicitly configure the RID on Core1 and Core2, so those routers list the router-id 1.1.1.1 and router-id 2.2.2.2 commands, respectively. For the two branch routers, just for variety, the lab asked you to let these routers set their RID based on the IP addresses of their loopback0 interfaces. To make that work, you have to first create the loopback interface (interface loopback 0), and then configure the IP address. (Note that if you tried this on your own lab, you need to create the loopback interface first, before bringing up the OSPF process, so that the loopback interface is up when OSPF comes up.)
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.Â
- Verify the OSPF neighbor relationships with the show ip ospf neighbor command. The two core routers should list two neighbors each, and the two branch routers should list one neighbor each.
- Check the routing tables, using the show ip route command, to ensure that all known networks have been learned on each device. Each router should list five subnets, with 3 subnets learned by OSPF.
- From the branch routers, also test connectivity with the ping command. For instance, on router Branch1, use the ping 172.30.1.65 source 172.30.1.1 command to issue an extended ping from Branch1’s G0/2 interface IP address (172.30.1.1) to router Branch2’s G0/2 interface address (172.30.1.65).
not to be a stickler for the details, but you forgot to use the router-id configuration subcommand on both the branch routers in the answer…
ahh i see the rid is automatically chosen from the loopback interface ip address…
but after configuration a ‘clear ip ospf [pid] process’ would be necessary?
PT acts much differently than real gear in regards to changing the OSPF RID. It usually picks it up immediately. On real, the only time a clear command changes the RID happens to be when configured anew with the router-id subcommand. So in this scenario, on real, it would take a reload.
Hi, I am unable to ping Branch2’s g0/2 from Branch1 and vice versa. However, I can ping Both Branch router’s g0/1 ints. Is OSPF failing to advertise the LAN subnets? If so, how to resolve this issue? Thanks!
Hi Lucas,
The short answer is yes, I would imagine you have some OSPF issue. You can confirm your OSPF config on all devices, and think through that. Or, just ping and traceroute. EG, go to Branch1 and ping the next-hop address you’d expect the route to use (an address on Core1). If that works, for the next router (Core 2), and then on Brnach 2. Also, use source pings, on Branch1, using its G0/2 interface as the source interface, to test the correct reverse routes. Or issue a traceroute (or extended traceroute w/ Branch1’s G0/2 as the source interface) to help troubleshoot.
Or, do general OSPF troubleshooting. Make sure all the OSPF neighbor relationships are up, if not, look for the interfaces on which OSPF is enabled, and to what areas you’ve assigned them. If neighbors are up, check the ip routing tables, and see what routes are missing.
Let me know what you figure out.
Wendell
Oops, I goofed! I used host subnet masks on the interfaces.
Nevermind! All is working now. Thanks
Greetings Mr. Wendell!
Thank you for the lab, I definitely learned a lot! Just had a weird question regarding the config in routers branch1 & branch2. (Guess I learned this the hard way haha). In real gear, do you still need the “router ospf 50” command in scenarios like these even though we are not configuring the RID explicitly in config-router mode? The reason why I’m asking is because I was having issues pinging the branch routers. I configured the “router ospf 50” global command in branch1 but not in branch2. However, even though I didn’t, since I configured the “ip ospf 50 area 20” from interface mode, the command “router ospf 50” appeared dynamically in “show running-config” even though I never entered it manually. My configuration matched with yours, all the OSPF interfaces were up, the neighbor relationships were up as well, but the Branch routers were still not pinging each other. Then, I noticed that Core1 and Branch1 were not learning routes from area 20, so I knew the issue had to be on the routers involved with area 20. It wasn’t until I manually entered the global command “router ospf 50” in Branch2, that the left side routers learned the routes related with area 20, and the pings finally worked. I hope my amateur explanation made sense, but if it did, would this be a PT issue, or does the global command “router ospf 50” needed to be manually entered regardless of OSPF being enabled via network style or interface style? Thanks in advance!
Good to hear from you, Mizael.
I do believe that’s a quirk of CPT behavior. In fact, w/ OSPF in particular, I’ve found that it helps to configure, save, and reload the router. Or even save the CPT file, and then re-open it. Sometimes, the dynamic configuration steps land on odd behavior, and a reload or restart of the CPT file does the trick.
Ah ok, thank you for the tip. So, in real gear, if I was to configure OSPF via interface-mode with the “ip ospf (process-id) area (area-id)” command, I wouldn’t have to create the process ID manually? (Like with the global command “router ospf (process-id)”
Correct! 🙂