Configure Single-Area OSPFv2
Configure Single-Area OSPFv2
Topology
Addressing Table
Objectives
Part 1: Build the Network and Configure Basic Device Settings
Part 2: Configure and Verify Single-Area OSPFv2 for basic operation
Part 3: Optimize and Verify the Single-Area OSPFv2 configuration
Background / Scenario
You have been tasked with configuring a small company’s network using OSPFv2. R1 will be
hosting an internet connection (simulated by interface Loopback 1) and sharing the default route
information to R2. After the initial configuration, the organization has asked for the configuration to
be optimized to reduce protocol traffic and ensure that R1 remains in control of routing.
Note: The static routing approach used in this lab is to assess your ability to configure and adjust
OSPFv2 in a single-area configuration. This approach used in this lab may not reflect networking
best practices.
Note: The routers used with CCNA hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.4
(universalk9 image). The switches used in the labs are Cisco Catalyst 2960s with Cisco IOS Release
15.2(2) (lanbasek9 image). Other routers, switches, and Cisco IOS versions can be used. Depending
on the model and Cisco IOS version, the commands available and the output produced might vary
from what is shown in the labs. Refer to the Router Interface Summary Table at the end of the lab
for the correct interface identifiers.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
Note: Ensure that the routers and switches have been erased and have no startup configurations. If
you are unsure contact your instructor.
Required Resources
2 Routers (Cisco 4221 with Cisco IOS XE Release 16.9.4 universal image or comparable)
2 Switches (Cisco 2960 with Cisco IOS Release 15.2(2) lanbasek9 image or comparable)
1 PC (Windows with a terminal emulation program, such as Tera Term)
Console cables to configure the Cisco IOS devices via the console ports
Ethernet cables as shown in the topology
Instructions
router(config)# hostname R1
router(config)# hostname R2
b. Disable DNS lookup to prevent the router from attempting to translate incorrectly entered
commands as though they were host names.
R1(config-line)# login
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
R2(config-line)# login
R1(config-line)# login
R2(config-line)# login
g. Create a banner that warns anyone accessing the device that unauthorized access is prohibited.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
switch(config)# hostname S1
switch(config)# hostname S2
b. Disable DNS lookup to prevent the router from attempting to translate incorrectly entered
commands as though they were host names.
S1(config-line)# login
S2(config-line)# login
S1(config-line)# login
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
S2(config-line)# login
g. Create a banner that warns anyone accessing the device that unauthorized access is prohibited.
R1(config-if)# no shut
R1(config-if)# exit
R1(config-if)# exit
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
R2(config-if)# no shut
R2(config-if)# exit
R2(config-if)# exit
c. Configure a static router ID for each router (1.1.1.1 for R1, 2.2.2.2 for R2).
d. Configure a network statement for the network between R1 and R2 placing it in area 0.
e. On R2 only, add the configuration necessary to advertise the Loopback 1 network into OSPF
area 0.
OR
f. Verify OSPFv2 is operational between the routers. Issue the command to verify R1 and R2 have
formed an adjacency.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
Question:
Which router is identified as the DR? Which is the BDR? What was the selection criteria?
Answers may vary. In my case R1 was configured first and was speaking OSPF before R2. So during
the OSPF election only R1 was configured for OSPF and became the DR. After R2 was configured for
OSPF it became the BDR on the Gigabit segment. The router with the highest router ID is used in the
selection of DR and BDR.
g. On R1, issue the show ip route ospf command to verify that the R2 Loopback1 network is
present in the routing table. Notice the default behavior of OSPF is to advertise a loopback
interface as a host route using a 32 bit mask.
<output omitted>
h. Ping the R2 Loopback 1 interface address from R1. The ping should succeed.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
!!!!!
b. Configure the OSPF timers on the G0/0/1 of each router for a hello timer of 30 seconds.
c. On R1, configure a default static route that uses interface Loopback 1 as the exit interface. Then,
propagate the default route into OSPF. Note the console message after setting the default route.
%Default route without gateway, if not a point-to-point interface, may impact performance
d. On R2 only, add the configuration necessary for OSPF to treat R2 Loopback 1 like a point-to-
point network. This results in OSPF advertising Loopback 1 using the interface subnet mask.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
R2(config-if)# exit
e. On R2 only, add the configuration necessary to prevent OSPF advertisements from being sent to
the Loopback 1 network.
R2(config-router)# exit
f. Change the reference bandwidth on each router to 1Gbs. After this configuration, restart OSPF
using the clear ip ospf process command. Note the console message after setting the new
reference bandwidth.
R1(config-router)# end
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
0 10 no no Base
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
Next 0x0(0)/0x0(0)/0x0(0)
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
b. On R1, issue the show ip route ospf command to verify that the R2 Loopback1 network is
present in the routing table. Note the difference in the metric between this output and the
previous output. Also note the mask is now 24 bits as opposed to the 32 bits previously
advertised.
<output omitted>
c. On R2, issue the show ip route ospf command. The only OSPF route information should be the
default route R1 is propagating.
<output omitted>
d. Ping the R1 Loopback 1 interface address from R2. The ping should succeed.
Question:
!!!!!
Why is the OSPF cost for the default route different than the OSPF cost at R1 for the
192.168.1.0/24 network?
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 12 www.netacad.com
Lab - Configure Single-Area OSPFv2
A default static route imported into OSPF is given the metric type of “E2” or External Type 2 by default.
An “E2” by default, keeps the same OSPF cost across the entire OSPF network. In this case, the metric
for the default route was 1, so it has a metric of 1 everywhere in the OSPF 56 network. The
192.168.1.0 /24 network is an internal OSPF route whose metric is cumulative.
Fast Ethernet 0/0 Fast Ethernet 0/1 Serial 0/0/0 Serial 0/0/1
1800 (F0/0) (F0/1) (S0/0/0) (S0/0/1)
Gigabit Ethernet 0/0 Gigabit Ethernet 0/1 Serial 0/0/0 Serial 0/0/1
1900 (G0/0) (G0/1) (S0/0/0) (S0/0/1)
Fast Ethernet 0/0 Fast Ethernet 0/1 Serial 0/1/0 Serial 0/1/1
2801 (F0/0) (F0/1) (S0/1/0) (S0/1/1)
Fast Ethernet 0/0 Fast Ethernet 0/1 Serial 0/0/0 Serial 0/0/1
2811 (F0/0) (F0/1) (S0/0/0) (S0/0/1)
Gigabit Ethernet 0/0 Gigabit Ethernet 0/1 Serial 0/0/0 Serial 0/0/1
2900 (G0/0) (G0/1) (S0/0/0) (S0/0/1)
Gigabit Ethernet Gigabit Ethernet Serial 0/1/0 Serial 0/1/1
4221 0/0/0 (G0/0/0) 0/0/1 (G0/0/1) (S0/1/0) (S0/1/1)
Gigabit Ethernet Gigabit Ethernet Serial 0/1/0 Serial 0/1/1
4300 0/0/0 (G0/0/0) 0/0/1 (G0/0/1) (S0/1/0) (S0/1/1)
Note: To find out how the router is configured, look at the interfaces to identify the type of router and
how many interfaces the router has. There is no way to effectively list all the combinations of
configurations for each router class. This table includes identifiers for the possible combinations of
Ethernet and Serial interfaces in the device. The table does not include any other type of interface, even
though a specific router may contain one. An example of this might be an ISDN BRI interface. The
string in parenthesis is the legal abbreviation that can be used in Cisco IOS commands to represent the
interface.
End of document
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 12 www.netacad.com