CCNA 200-301, Volume
I
Chapter 20
Implementing
Objectives
• Implementing Single-Area OSPFv2
• OSPFv2 Interface Configuration
• Additional OSPFv2 Features
Implementing Single-Area OSPF
• Step 1. Use the router ospf process-id global command to enter OSPF
configuration mode for a particular OSPF process.
• Step 2. (Optional) Configure the OSPF router ID by doing the following:
▫ A. Use the router-id id-value router subcommand to define the router ID.
▫ B. Use the interface loopback number global command, along with an ip address
address mask command, to configure an IP address on a loopback interface (chooses
the highest IP address of all working loopbacks).
▫ C. Rely on an interface IP address (chooses the highest IP address of all working
nonloopbacks).
• Step 3. Use one or more network ip-address wildcard-mask area
area-id router subcommands to enable OSPFv2 on any interfaces
matched by the configured address and mask, enabling OSPF on the
interface for the listed area.
• Step 4. (Optional) Use the passive-interface type number router
subcommand to configure any OSPF interfaces as passive if no
neighbors can or should be discovered on the interface.
Implementing Single-Area OSPF
Sample Network for OSPF Single-Area
Configuration
IPv4 Address Configuration on R1 (Including VLAN
Trunking)
Implementing Single-Area OSPF
• The router ospf 1 global command puts the users into OSPF
configuration mode and sets the OSPF process-id to 1.
• This process-id just needs to be unique on the local router and be
between 1 and 65,535.
• The OSPF network command tells the router to find its local
interfaces that match the first two parameters in the command.
• Those interfaces then discover neighbors, create neighbor
relationships and assign the interface to the area listed.
Matching with the OSPF network
Command
• The wildcard mask gives the local router its rules for matching its
own interfaces:
▫ Wildcard 0.0.0.0: Compare all 4 octets. In other words, the numbers must exactly
match.
▫ Wildcard 0.0.0.255: Compare the first 3 octets only. Ignore the last octet when
comparing the numbers.
▫ Wildcard 0.0.255.255: Compare the first 2 octets only. Ignore the last 2 octets
when comparing the numbers.
▫ Wildcard 0.255.255.255: Compare the first octet only. Ignore the last 3 octets
when comparing the numbers.
▫ Wildcard 255.255.255.255: Compare nothing—this wildcard mask means that all
addresses will match the network command.
Matching with the OSPF network
Command
Matching with the OSPF network
Command
OSPF Verification Commands
Verifying OSPFv2 Single Area
• Interface: This is the local router’s interface connected to the
neighbor. For example, the first neighbor in the list is reachable
through R3’s S0/0/0 interface.
• Address: This is the neighbor’s IP address on that link. Again, for
this first neighbor, the neighbor, which is R1, uses IP address
10.1.13.1.
• State: While many possible states exist, for the details discussed
in this chapter, FULL is the correct and fully working state in this
case.
• Neighbor ID: This is the router ID of the neighbor.
Verifying OSPFv2 Single Area
• When OSPF is working correctly in the internetwork with a
single-area design, all of the routers will have the same LSDB
contents.
• For the purposes of the CCNA knowledge of the specifics about
the output of this command are not required.
IPv4 Routes Added by OSPF
Router R3 Configuration and the show ip protocols
Command
show ip ospf interface brief Command
Configuring the OSPF Router ID
• OSPF speaking routers must have a router-ID (RID) for proper
operation.
• By default, routers will choose an interface IP address to use as
the RID.
• Typically, engineers prefer to choose each router’s RID.
• A Cisco router uses the following process when the router
reloads and brings up the OSPF process to find the RID:
1. If the router-id rid OSPF subcommand is configured, this value is used as the
RID.
2. If any loopback interfaces have an IP address configured, and the interface has
an interface status of up, the router picks the highest numeric IP address
among these loopback interfaces.
3. The router picks the highest numeric IP address from all other interfaces
whose interface status code (first status code) is up. (In other words, an
OSPF Router ID Configuration
Examples
Implementing Multiarea OSPF
OSPF Single-Area Configuration
OSPF Single-Area Configuration
OSPF Passive Interfaces
• An OSPF interface configured as passive will do the following:
▫ Quit sending OSPF Hellos on the interface.
▫ Ignore received Hellos on the interface.
▫ Do not form neighbor relationships over the interface.
• OSPF does not form neighbor relationships over interfaces
configured as passive, but does still advertise about the subnet
connected to that interface.
OSPF Passive Interfaces
• To configure an interface as passive there are two options:
▫ Adding the passive-interface type number command under router
configuration mode.
▫ Configuring interfaces as passive by default with the passive-interface default
command under global configuration mode and using the no passive-interface
type number command to disable passive of specific interfaces.
OSPF Passive Interfaces
• OSPF makes it interesting to figure out which interfaces are passive:
▫ The show ip ospf interface brief command lists all interfaces on which OSPF is enabled including
passive interfaces.
▫ The show ip ospf interface command lists a single line that mentions that the interface is passive.
OSPF Default Routes
• The most classic case for using a routing protocol to advertise a
default route has to do with an enterprise’s connection to the
Internet.
• The enterprise engineer uses the following design goals:
▫ All routers learn specific routes for subnets inside the company; a default route
is not needed when forwarding packets to these destinations.
▫ One router connects to the Internet, and it has a default route that points toward
the Internet.
▫ All routers should dynamically learn a default route, used for all traffic going to
the Internet, so that all packets destined to locations in the Internet go to the one
router connected to the Internet.
OSPF Default Routes
• R1 has a static default route with a next-hop address of the ISP router.
• R1 uses the OSPF default-information originate command to advertise a default
route using OSPF to B1 and B2.
• R1 needs a default route, either defined as a static default route, learned from the
ISP with DHCP or learned from the ISP with a routing protocol like eBGP unless the
always parameter is used.
OSPF Default Routes
• The branch routers then place the learned OSPF default route into their routing
tables.
OSPF Default Routes
• R1 uses DHCP to learn its IP address on its Gi0/3 interface from the ISP.
• R1 then creates a static default route with the ISP router’s IP address of 192.0.2.1 as the next-hop
address.
OSPF Metrics (Cost)
• Cisco routers allow three different ways to change the OSPF
interface cost:
▫ Directly, using the interface subcommand ip ospf cost x.
▫ Using the default calculation per interface, and changing the interface
bandwidth setting, which changes the calculated value.
▫ Using the default calculation per interface, and changing the OSPF reference
bandwidth setting, which changes the calculated value.
• IOS uses the Reference_bandwidth / Interface_bandwidth
formula to choose an interface’s cost.
• With this formula the following sequence of logic happens:
1. A higher interface bandwidth—that is, a faster bandwidth—results in a lower
number in the calculation.
2. A lower number in the calculation gives the interface a lower cost.
3. An interface with a lower cost is more likely to be used by OSPF when
calculating the best routes.
OSPF Metrics (Cost)
OSPF Metrics (Cost)
OSPF Load Balancing
• Typically when SPF calculates the metric of several routes, one
route will have the lowest metric, so OSPF puts it into the routing
table.
• When metrics tie for multiple routes to the same subnet, the
router can put multiple equal-cost routes into the routing table.
(By default, up to 4.)
• This default can be altered with the maximum-paths number
command.
• Routers can load balance in one of two ways:
▫ On a per-packet basis, where each new packet it forwarded out the next path in
round robin.
▫ On a per-destination bases, where packets are forwarded using the same path
for each specific IP destination.