Basic Cisco Router OSPF Configuration

- select the contributor at the end of the page -
This article is the fourth in a series of articles covering the basics of Cisco networking. This article takes a look at the configuration of Open Shortest Path First (OSPF); OSPF is a standard internal gateway protocol (IGP) that is used by many different types and sizes of companies.

OSPF Concepts

The current version of OSPF that is used for IPv4 is version 2 that was defined in Request for Comments (RFC) 2328. OSPF offers many advantages over previous routing protocols (RIP) in that it is very flexible and scalable to a number of different environments including those that are very large. OSPF is a link state routing protocol; this means that each OSPF device is tasked with maintaining a complete ‘map' of the routes available throughout the network. The OSPF metric is based on the interface bandwidth. Specifically, the metric is formulated by taking 100,000,000 (100 Mbps) and dividing it by the interface bandwidth. It then uses this information to determine the best path possible based on the Dijkstra's algorithm.

OSPF also supports the division of the OSPF domain through the use of areas. Summarization and filtering can then be used at the area boundaries to ensure that the routing tables at the center of the OSPF domain are kept to an efficient number of routes. This center of the OSPF domain is referred to as area 0 or the OSPF backbone. All OSPF areas must have a direct connection with area 0.

OSPF Configuration

One of OSPFs biggest disadvantages is that its configuration can become quite complex. Because of this many new network engineers can misconfigure OSPF. The first step is to gain access to the Cisco device and access global configuration mode. If this process is not familiar learn how to set up a Cisco router first. Once this mode has been accessed the prompt should look like Figure 1.

Global Configuration Mode

Figure 1 - Global Configuration Mode

To configure OSPF the first step is to create an OSPF routing instance. This is done with the 'router ospf process-id' command. This is shown in Figure 2.

Creating an OSPF Router Instance

Figure 2 - Creating an OSPF router instance

An important distinction between OSPF and EIGRP is that the OSPF process-id does not have to be the same from one OSPF device to another like an EIGRP autonomous-system-number.

Like RIP and EIGRP, the next part requires knowledge of the networks that will be advertised from this device. To make it simple this article will again use the same network that is used in both the RIP and EIGRP articles. The command that is required for this is 'network network network-inverse-mask area area.' This is shown in Figure 3.

Configure the Advertised OSPF Network

Figure 3 - Configure the Advertised OSPF network

This is often when new network engineers get a bit confused. What exactly is an inverse mask? For this the original subnet mask needs to be seen in its binary form. For this is easy: 11111111 11111111 11111111 00000000. The inverse of this is simply flipping each bits valid to their opposite: 0 to 1 and 1 to 0. This will give an inverse mask of 00000000 00000000 00000000 11111111 or What this is telling OSPF is that all interfaces on the local device that have been assigned with an IP network that exists between and will be inserted into the OSPF process. How this is calculated is by looking at which bits are being matched with the inverse mask; if the binary value is a 0 then the bit must exactly match, if the binary value is a 1 then the bit can be either a 0 or a 1. A visualization of this is shown in Figure 4.

Inverse Mask Example

Figure 4 - inverse mask example


While the configuration of OSPF can get complex, once some basic concepts are understood a basic configuration is not all that confusing to understand or complete. The configuration of OSPF in a large scale implementation can be a bit hard to follow when quickly looking over a configuration, but if the network engineer knows the base OSPF concepts and sits down with the configuration then they should be able to figure out the intention of the OSPF design. Hopefully the content of this article will allow the reader to get started with their understanding of OSPF and how it operates.

Ready to test your skills in CISCO? See how they stack up with this assessment from Smarterer. Start this CISCO test now

Get our content first. In your inbox.

Loading form...

If this message remains, it may be due to cookies being disabled or to an ad blocker.


Sean Wilkins

Sean Wilkins is an accomplished networking consultant who has been in the IT field for more than 20 years, working with several large enterprises. He is a writer for infoDispersion and his educational accomplishments include: a Master’s of Science in Information Technology with a focus in Network Architecture and Design, and a Master’s of Science in Organizational Management. Sean holds certifications with Cisco (CCNP/CCDP), Microsoft (MCSE) and CompTIA (A+ and Network+).