OSPF Configuration – Step By Step Guide

In the previous post, we discussed a lot about the OSPF routing protocol. Now, it’s time to reflect your knowledge in a network topology to enhance your hands-on skills. In this post, we will discuss step by step OSPF configuration. For this, we will demonstrate OSPF configuration using Cisco Packet Tracer. The same commands can be used to perform the OSPF configuration on GNS3 or real cisco routers.

We will use the following Cisco Packet Tracer topology to configure OSPF routing protocol.OSPF configuration

We assume that the IP address configuration is already configured on each router and PC as per the following table.Configure OSPF Routing

OSPF Configuration Command Syntax

Once you have configured the appropriate IP addresses on each device. Execute the show ip interface brief command on each router to verify the IP configuration. Once you verified the IP configuration on each router, proceed to the next section.

  • The OSPF routing protocol uses the following command syntax.
Router(config)#router ospf <process id 1-65535>
Router(config-router)network <network address> <wild card mask> area <0-4294967295>

Note: You can define an area number either in the decimal format or in the IP address format. For example, the area number 20 can be defined as 20 in the decimal format or as 0.0.0.20 in the IP address format.

OSPF Configuration Steps

To configure OSPF routing protocol on the above-mentioned topology, you need to perform the following steps.

  1. Move on to Router1 and execute the following commands to specify the OSPF network and area.
    Router1(config)#router ospf 200
    Router1(config-router)#network 10.0.0.0 0.255.255.255 area 0
    Router1(config-router)#network 192.168.1.0 0.0.0.255 area 0.0.0.0
    Router1(config-router)#exit
  2. The following figure displays the OSPF configuration commands on Router1.OSPF Configuration on Cisco Router
  3. Next, move on to Router2 and execute the following commands to specify OSPF networks and areas.
    Router2(config)#router ospf 200
    Router2(config-router)#network 20.0.0.0 0.255.255.255 area 0
    Router2(config-router)#network 192.168.1.0 0.0.0.255 area 0
    Router2(config-router)#network 150.150.150.0 0.0.0.255 area 1
    Router2(config-router)#exit
    Router2(config)#exit
  4. The following figure shows the OSPF configuration commands on Router2.OSPF Routing Protocol
  5. On Router3, execute the following commands.
    Router3(config)#router ospf 200
    Router3(config-router)#network 150.150.150.0 0.0.0.255 area 1
    Router3(config-router)#exit
    Router3(config)#exit
  6. Once you have configured the OSPF routing protocol on all the routers, execute the following command on Router3 (or any other router) to view the routing table.
    Router3#show ip route
  7. The output of the show ip route command is displayed in the following figure.OSPF routing table
  8. In the preceding figure, you can see that the 10.0.0.0/8, 20.0.0.0/8, and 192.168.1.0/24 networks are added through the OSPF routing protocol on Router3.

Verifying OSFP Configuration

To verify and test the OSPF configuration, execute the following commands on any router and review the output of each command.

  • To view the OSPF neighbor routers, execute the following command.
Router#show ip ospf neighbor
  • To view the OSPF border routers, execute the following command.
Router#show ip ospf border-routers
  • The following figure shows the output of the show ip ospf neighbor and show ip ospf border-routers commands.show ip ospf border-routers command
  • To view the OSPF routing database, execute the following command.
Router#show ip ospf database
  • The following figure shows the output of the show ip ospf database command.

OSPF Show IP database command

To test the connectivity between all the devices in the above-mentioned network topology, execute the ping 10.0.0.2 command on Router3. You should be able to communicate to PC0.

In this post, we have discussed step by step OSPF configuration commands with examples. Hope, you have enjoyed it. Make it enjoyable for others too by just sharing this article.

Posted in Cisco, Routing Tagged with: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*