OSPF configuration on a Cisco router: step by step with examples

Note

The configuration and verification of OSPFv3 and multiarea OSPF in both OSPFv2 and OSPFv3 are not part of the blueprint for the new edition of the CCNA certification exam (200-301). Troubleshooting OSPF (v2 and v3) is part of the Implementing Cisco Enterprise Advanced Routing and Services exam (300-410), an optional concentration exam of the new CCNP Enterprise certification. Configuring multiarea OSPF is part of the Implementing Cisco Enterprise Network Core Technologies exam (300-401). Both of these CCNP exam topics will be in the new CCNP Portable Command Guide, to be released in early 2020.


This article provides information about the following topics:

The current version of Open Shortest Path First (OSPF), OSPFv2, was developed back in the late 1980s, when some parts of OSPF were designed to compensate for the inefficiencies of routers at that time. Now that router technology has dramatically improved, and with the arrival of IPv6, rather than modify OSPFv2 for IPv6, it was decided to create a new version of OSPF (OSPFv3), not just for IPv6, but for other newer technologies, too.

In most Cisco documentation, if you see something refer to OSPF, it is assumed to be referring to OSPFv2, and working with the IPv4 protocol stack.

The earliest release of the OSPFv3 protocol worked with IPv6 exclusively; if you needed to run OSPF for both IPv4 and IPv6, you had to have OSPFv2 and OSPFv3 running concurrently. Newer updates to OSPFv3 are allowing for OSPFv3 to handle both IPv4 and IPv6 addressing. The combining of IPv4 and IPv6 into OSPFv3 is not part of the CCNA certification; it is part of the CCNP Enterprise certification and therefore out of scope for this guide. This guide works with the understanding that anything related to IPv4 will be using OSPFv2.

Caution

Running two different OSPF processes does not create multiarea OSPF; it merely creates two separate instances of OSPF that do not communicate with each other. To create multiarea OSPF, you use two separate network statements and advertise two different links into different areas. Remember that multiarea OSPF is not part of the CCNA (200-301) vendor exam topics.

Note

You can enable OSPF directly on an interface with the ip ospf process ID area area number command. Because this command is configured directly on the interface, it takes precedence over the network area command entered in router configuration mode.

When compared to an IP address, a wildcard mask identifies what addresses are matched to run OSPF and to be placed into an area:

  • A 0 (zero) in a wildcard mask means to check the corresponding bit in the address for an exact match.

  • A 1 (one) in a wildcard mask means to ignore the corresponding bit in the address—can be either 1 or 0.

Example 1: 172.16.0.0 0.0.255.255

      172.16.0.0 = 10101100.00010000.00000000.00000000

    0.0.255.255 = 00000000.00000000.11111111.11111111

             Result = 10101100.00010000.xxxxxxxx.xxxxxxxx

172.16.x.x (Anything between 172.16.0.0 and 172.16.255.255 matches the example statement)

Tip

An octet in the wildcard mask of all 0s means that the octet has to match the address exactly. An octet in the wildcard mask of all 1s means that the octet can be ignored.

Example 2: 172.16.8.0 0.0.7.255

    172.16.8.0 = 10101100.00010000.00001000.00000000

   0.0.0.7.255 = 00000000.007000000.00000111.11111111

            Result = 10101100.00010000.00001xxx.xxxxxxxx

      00001xxx = 00001000 to 00001111 = 8–15

       xxxxxxxx = 00000000 to 11111111 = 0–255

Anything between 172.16.8.0 and 172.16.15.255 matches the example statement

Tip

If you have problems determining which wildcard mask to use to place your interfaces into an OSPF area, use the ip ospf process ID area area number command directly on the interface.

Tip

If you assign interfaces to OSPF areas without first using the router ospf x command, the router creates the router process for you, and it shows up in a show running-config output.

Loopback interfaces are always “up and up” and do not go down unless manually shut down. This makes loopback interfaces great for use as an OSPF router ID.

Note

To choose the router ID at the time of OSPF process initialization, the router uses the following criteria in this specific order:

  1. Use the router ID specified in the router-id w.x.y.z command.

  2. Use the highest IP address of all active loopback interfaces on the router.

  3. Use the highest IP address among all active nonloopback interfaces.

Note

To have the manually configured router ID take effect, you must clear the OSPF routing process with the clear ip ospf process command.

Note

There is no IPv6 form of router ID. All router IDs are 32-bit numbers in the form of an IPv4 address. Even if a router is running IPv6 exclusively, the router ID is still in the form of an IPv4 address.

Caution

Hello and dead interval timers must match between two routers for those routers to become neighbors.

Note

The default hello timer is 10 seconds on multiaccess and point-to-point segments. The default hello timer is 30 seconds on nonbroadcast multiaccess (NBMA) segments such as Frame Relay, X.25, and ATM.

Note

The default dead interval timer is 40 seconds on multiaccess and point-to-point segments. The default dead timer is 120 seconds on NBMA segments such as Frame Relay, X.25, and ATM.

Note

If you change the hello interval timer, the dead interval timer is automatically adjusted to four times the new hello interval timer.

Figure 16-1 shows the network topology for the configuration that follows, which demonstrates how to configure single-area OSPF using the commands covered in this post.

Вас заинтересует / Intresting for you:

Configuring a Cisco Router: fi...
Configuring a Cisco Router: fi... 1342 views Валерий Павлюков Sun, 06 Feb 2022, 18:18:52
Cisco Discovery Protocol (CDP)...
Cisco Discovery Protocol (CDP)... 1009 views Валерий Павлюков Sat, 05 Feb 2022, 17:35:12
Cisco: Resetting Switch Config...
Cisco: Resetting Switch Config... 1714 views Андрей Волков Mon, 15 Feb 2021, 19:13:09
Cisco Switch Configuration: st...
Cisco Switch Configuration: st... 1925 views Валерий Павлюков Sun, 06 Feb 2022, 16:39:35
Comments (1)
This comment was minimized by the moderator on the site

Nice article! Big thanks!

1dz
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Suggested Locations