Config Lab: OSPF Network Config 2

Wendell Odom
By Wendell Odom September 21, 2021 16:05

What if your #CCNA exam required you to configure the OSPF network command with a particular style of mask? What if it said “match all addresses in the subnet”, or “match all addresses in the classful network”? Or even “match only the specific interface addresses”? Could you change from using your preferred method of configuring the OSPF network commands to doing it their way? Today’s lab gives you a chance to practice, in about 5-10 minutes. Enjoy!

All about Config Labs

The blog has a series of lab exercises called “Config Labs.” Each lab presents a topology with the relevant initial configuration for each device. The lab also lists new requirements, after which you should create the additional configuration to meet those requirements. You can do the lab on paper, in a text editor, or use software tools like Cisco Packet Tracer or Cisco Modeling Labs.

Once you have created your answer, you can click various tabs at the bottom of this post to see the lab answers, comments about the lab, and other helpful information.

The Lab Exercise


Configure legacy OSPF (using network commands) between R1, R2 and R3. As a means to let you exercise the network command, this lab varies the requirements for the network commands on each router. The specific rules for this lab, for all three routers, are:

  • Configure each router with a router-id of x.x.x.x where x equals the router number.
  • Use OSPF area 0
  • Use an OSPF process ID number of 5

Additionally, because the network command could use many different wildcard masks, use the following rules when choosing the wildcard masks to use on each router:

  • Router R1: Each network command should match classful networks only, that is, match class A, B, and C networks.
  • Router R2: Each network command should match the specific IPv4 addresses of the router interfaces.
  • Router R3: Each network command should match the subnets of the router interfaces.

Note that in a real network, you would probably pick one style over another and use that on all routers. This lab uses a variety just to give you a variety of practice.

Figure 1: Three Router Triangle with IP Subnets


Initial Configuration

Example 1, 2 and 3 show the beginning configuration state of R1, R2 and R3.

Example 1: R1 Config


Example 2: R2 Config


Example 3: R3 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:

  1. Download the .pkt file linked below.
  2. Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
  3. Add your planned configuration to the lab.
  4. Test the configuration using some of the suggestions below.

Download this lab’s Packet Tracer File

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:

  1. Download the CML file (filetype .yaml) linked below.
  2. Import the lab’s CML file into CML and then start the lab.
  3. Compare the lab topology and interface IDs to this lab, as they may differ (more detail below).
  4. Add your planned configuration to the lab.
  5. Test the configuration using some of the suggestions below.

Download this lab’s CML file!


Network Device Info:

This table lists the interfaces listed in the lab exercise documentation versus those used in the sample CML file.

Device Lab Port  CML Port
R1 G0/0 G0/3
R2 G0/0 G0/3
R3 G0/0 G0/3


Host device info:

This table lists host information pre-configured in CML, information that might not be required by the lab but may be useful to you.

Device IP Address Mac Address User/password
PC1 02:00:11:11:11:11 cisco/cisco
PC2 02:00:22:22:22:22 cisco/cisco
PC3 02:00:33:33:33:33 cisco/cisco

Lab Answers Below: Spoiler Alert

Lab Answers: Configuration (Click Tab to Reveal)


Figure 1: Three Router Triangle with IP Subnets

Example 4: R1 Config


Example 5: R2 Config


Example 6: R3 Config

Commentary, Issues, and Verification Tips (Click Tabs to Reveal)


First, ignore the network commands for a moment. For this lab, each of the routers will be configured with an OSPF process ID of 5 (this is a locally significant number only). R1, R2, and R3 will be configured with router-id values of,, and, respectively, using the router-id command.

Could you have used different process IDs and router IDs? Sure. Those are simply the numbers this lab exercise asked you to use.

The most problematic area that people have with the legacy configuration of OSPF is with the network command, specifically the wildcard mask. The wildcard mask (as used with IP Access Control Lists, or ACLs) limits the parts of the interface IP addresses compared to the number in a network command.


Deeper Background

While this lab does not get into all the theories of wildcard masks, I felt the need for a little more detail than usual in this case. To match all addresses in a classful network, you need to use one of three easily understood wildcard masks. In particular:

  • Class A: Wildcard mask means “compare the first 1 octet, ignore the last 3”, which is useful for matching all addresses in a class A network
  • Class B: Wildcard mask means “compare the first 2 octets, ignore the last 2 octets”, which is useful for matching all addresses in a class B network
  • Class C: Wildcard mask means “compare the first 3 octets, ignore the last 1 octet”, which is useful for matching all addresses in a class C network

To match all addresses in the subnet connected to an interface, you have two calculate two values. First, calculate the subnet ID as usual. Then, calculate the wildcard mask by subtracting the subnet mask from That is, if you subtract a subnet mask (in dotted decimal form) from, the resulting wildcard mask can be used when matching all packets in a subnet that uses that mask. For instance:

  • To match subnet, use wildcard mask
  • To match subnet, use wildcard mask
  • To match subnet, use wildcard mask


Network Commands on R1

The lab asked us to match only classful networks with R1’s network command. As it turns out, R1 connects to two different class B networks: and As class B networks, with default mask, the correct wildcard mask to match that range of addresses is, meaning “match interfaces with the same first two octets.” The two network commands list the classful networks, wildcard mask, and area 0.


Network Commands on R2

For R2, the lab asked us to match the specific IP addresses on the interface. To do that, use wildcard mask, which means “all four octets of the address must match.” With three interfaces configured with IPv4 addresses, R2 needed three network commands, each listing the exact IPv4 address of R2’s interfaces, with wildcard mask


Network Commands on R3

R3 has the requirement that each network command matches only the addresses in a single subnet. To create this configuration, each network command uses the DDN subnet mask, subtracted from R3 uses two different subnet masks, resulting in two different wildcard masks, as follows: – results in wildcard mask – results in wildcard mask

The resulting configuration lists two network commands that happen to have a wildcard mask of because two interfaces on R3 (G0/1, G0/2) use DDN wildcard mask The last network command on R3 uses wildcard mask, along with subnet, which matches all IP addresses in subnet

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. 

  1. Each router should have two OSPF neighbors; verify that fact with the show ip ospf neighbor command.
  2. Each router should list three OSPF-learned routes, which you can verify with the show ip route command. (If you view the links between routers as WAN links, the three OSPF routes will be for: the two remote LANs, plus the WAN link between the other two routers.)
  3. Verify which interfaces are enabled for OSPF with the show ip ospf interface brief command.
  4. Verify the OSPF router ID with the show ip ospf database command.

More Labs with Related Content!

Config Lab: OSPF Network Config 1
Config Lab: Multi-area OSPF 1
Wendell Odom
By Wendell Odom September 21, 2021 16:05
Write a comment


  1. Jeff Palin November 2, 13:21

    Hello Wendell,

    I’ve noticed that for this exercise, the visual diagram indicates interface numbers gi 0/0, 0/1 and 0/2. However, the “Initial-Configuration information” utlizes interface numbers gi 0/1, 0/2, and 0/3. This discrepancy causes issues for those of us who create the exercise from scratch. It would be very much appreciated if the Visual diagram matched the “details” of the “Initial-Configuration information”.Also, utilizing Packet Tracer, I have not seen whereby I have the ability to create interfaces utilizing the 0/X numbering format beyond 0/0. Therefore we resort to utilizing 1/0, 2/0, 3/0. Perhaps you would consider that going forward.

    Thanks for, and I appreciate, all that you do.

    Jeff Palin

    Reply to this comment
    • certskills November 2, 14:58

      All the Config Labs we updated in 2021 should, by design, match between the figure/interface IDs, the same in the supplied PAcket Tracer file, and the configs shown in the post. We just failed to update the initial config correctly in this post. I just updated the config in this post so they all match. Thanks for letting us know so we could improve it – much appreciated.

      PS You can create in Packet Tracer routers w/ G0/0, G0/1, and G0/2. Just open the file supplied with this lab and you’ll see those. Basically you start w/ a 2911 router and it comes with G0/0 – G0/2 with open slots to add others modules.

      Reply to this comment
      • Jeff Palin November 2, 15:04

        I appreciate your feedback. This may assist many others in their endeavors as well. I will look into the 2911 Router model! Thank you very much.

        Reply to this comment
        • certskills November 2, 16:48

          Sure thing, Jeff.
          By the way, you might also enjoy the “Cert Guide Packet Tracer Labs” series here at Those give you a head-start on recreating the examples from my CCNA Cert Guides in Packet Tracer. FYI.

          Reply to this comment
          • Jeff Palin November 3, 12:41

            Excellent! I love it! You really make us think. Doing your exercises…I’ve made mistakes I could not imagine. I’m sure they will happen in the real world. Great to work through and understand them here, before I get out into reality.

  2. Emma February 27, 18:31

    I believe the R3 and R2 configs are reversed in the solution.

    Reply to this comment
    • Wendell Odom Author March 2, 09:27

      Hi Emma,
      Yes indeed, you were right. Just fixed it – just reversed the captions. No changes to the configs, just pointed to the correct routers for each config snip.
      Thanks much,

      Reply to this comment
View comments

Write a comment

Comment; Identify w/ Social Media or Email


Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.