Config Lab: OSPF Network Config 2

 In 200-301 V1 Ch20: OSPF Config, 200-301 V1 Part 6: OSPF, 200-301 V1 Parts, Config Lab, Config Lab CCNA Vol 1 Part 6, Hands-on

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

Requirements

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.

hostname R1
!
interface GigabitEthernet0/0
 no shutdown
 ip address 172.16.1.1 255.255.255.0
!
interface GigabitEthernet0/1
 no shutdown
 ip address 172.30.1.1 255.255.255.252
!
interface GigabitEthernet0/2
 no shutdown
 ip address 172.30.1.10 255.255.255.252

Example 1: R1 Config

 

hostname R2
!
interface GigabitEthernet0/0
 no shutdown
 ip address 172.16.2.2 255.255.255.0
!
interface GigabitEthernet0/1
 no shutdown
 ip address 172.30.1.5 255.255.255.252
!
interface GigabitEthernet0/2
 no shutdown
 ip address 172.30.1.2 255.255.255.252

Example 2: R2 Config

 

hostname R3
!
interface GigabitEthernet0/0
 no shutdown
 ip address 172.16.3.3 255.255.255.0
!
interface GigabitEthernet0/1
 no shutdown
 ip address 172.30.1.9 255.255.255.252
!
interface GigabitEthernet0/2
 no shutdown
 ip address 172.30.1.6 255.255.255.252

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 172.16.1.2 02:00:11:11:11:11 cisco/cisco
PC2 172.16.2.3 02:00:22:22:22:22 cisco/cisco
PC3 172.16.3.4 02:00:33:33:33:33 cisco/cisco

Lab Answers Below: Spoiler Alert

Lab Answers: Configuration (Click Tab to Reveal)

Answers

Figure 1: Three Router Triangle with IP Subnets

router ospf 5
 router-id 1.1.1.1
 network 172.30.0.0 0.0.255.255 area 0
 network 172.16.0.0 0.0.255.255 area 0

Example 4: R1 Config

 

router ospf 5
 router-id 2.2.2.2
 network 172.30.1.2 0.0.0.0 area 0
 network 172.30.1.5 0.0.0.0 area 0
 network 172.16.2.2 0.0.0.0 area 0

Example 5: R2 Config

 

router ospf 5
 router-id 3.3.3.3
 network 172.30.1.4 0.0.0.3 area 0
 network 172.30.1.8 0.0.0.3 area 0
 network 172.16.3.0 0.0.0.255 area 0

Example 6: R3 Config

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

Commentary

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 1.1.1.1, 2.2.2.2, and 3.3.3.3, 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 0.255.255.255 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 0.0.255.255 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 0.0.0.255 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 255.255.255.255. That is, if you subtract a subnet mask (in dotted decimal form) from 255.255.255.255, the resulting wildcard mask can be used when matching all packets in a subnet that uses that mask. For instance:

  • To match subnet 10.1.1.0 255.255.255.0, use wildcard mask 0.0.0.255.
  • To match subnet 10.1.1.0 255.255.255.192, use wildcard mask 0.0.0.63.
  • To match subnet 10.1.1.0 255.255.255.224, use wildcard mask 0.0.0.31.

 

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: 172.16.0.0 and 172.30.0.0. As class B networks, with default mask 255.255.0.0, the correct wildcard mask to match that range of addresses is 0.0.255.255, meaning “match interfaces with the same first two octets.” The two network commands list the classful networks, wildcard mask 0.0.255.255, 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 0.0.0.0, 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 0.0.0.0.

 

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 255.255.255.255. R3 uses two different subnet masks, resulting in two different wildcard masks, as follows:

255.255.255.252 – results in wildcard mask 0.0.0.3

255.255.255.0 – results in wildcard mask 0.0.0.255

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

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
Subscribe
Notify of
guest

13 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Jeff Palin

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

certskills

Jeff,
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.
Wendell

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.

Jeff Palin

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.

certskills

Sure thing, Jeff.
By the way, you might also enjoy the “Cert Guide Packet Tracer Labs” series here at https://www.certskills.com/category/hands-on/pt-labs-200-301/. Those give you a head-start on recreating the examples from my CCNA Cert Guides in Packet Tracer. FYI.

Jeff Palin

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.

Emma

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

Angel Munoz

Hello Wendell,

Is only 1 solution acceptable?
I’m asking because I ended writing this for R1:

ip ospf 5
router-id 1.1.1.1
network 172.16.1.0 0.0.0.255 area 0
network 172.30.1.0 0.0.0.255 area 0
instead of

ip ospf 5
router-id 1.1.1.1
network 172.16.0.0 0.0.255.255 area 0
network 172.30.0.0 0.0.255.255 area 0

——————————————————-
Edit: I should have read the “Lab Commentary” section before, I see why I was wrong now: 172 falls in the classful class B range (128 – 191), so the corresponding wildcard mask should be 0.0.255.255, my bad.

Last edited 7 months ago by Angel Munoz
Angel Munoz

Sorry, I didn’t see the option to delete my comment by the way.

Bruno

I did benefit from this comment as I answered the same way as Angel. Thank you!

Ermundo Russell

Wendell,

The verification tips are very helpful. I try and review them and run the commands long before I check to see if I have the write answers. The lab commentary really brings it home. Helps me make sure I understand how I came up with my configs and if I was on the right track with concepts considered. Thank you for your hard work on these labs.

Wendell

You’re quite welcome, Ermundo! Glad to be of service.

13
0
Would love your thoughts, please comment.x
()
x