Configuring OSPF on a Cisco router

This recipe describes configuring OSPF (Open Shortest Path First) in a Cisco router. OSPF was created to provide a more scalable dynamic routing solution than RIP. OSPF utilizes less bandwidth because, once established, it only sends routing table updates when there are changes.


router(config)#router ospf 1
router(config-router)#network 10.130.0.0 0.0.255.255 area 130

The command turns on the OSPF routing protocol with a process id of 1. The network line must be added to tell the router which networks will be participating in OSPF. This command can be expanded to include stub areas and not so stubby areas. That is how Cisco refers to it. You can run multiple processes of OSPF using different process ids.

Related commands:
show ip ospf neighbor
show ip ospf interface

The Conversation

Follow the reactions below and share your own thoughts.

  • configuring a router is not easy. who is gonna help me out?

  • Anonymous

    i like configuring routers

  • Anonymous

    i want konw how to configure router with diffrent protocol ?please give some tips to understand quickly pls

  • Muhammedlceesay

    how can i configure ospf i need a feedback

    • Pavithren Pakianathan

      If you have one interface connected to your wan @ 10.10.10.1 subnet mask 255.255.255.252 and the other connected to your lan @ 192.168.15.1 subnet mask 255.255.255.0 then enter the following commands:
      router ospf 1network 192.168.15.1 0.0.0.255 area 0network 10.10.10.1 0.0.0.3 area 0follow this format:router ospf “process_id”network “ip_address” “wildcard_mask” area “area_no”
      –>process id is locally significant is is used to differentiate between OSPF processes running on the same router and they do not need to match between different routers.
      –>for the wildcard mask just subtract subnet mask from 255.255.255.255.

      • Muhammedlceesay

        like if i want to configure 5 routers in the same network so how can i configure ospf to work between 5 routers simualtenaously to work together and able to ping each other please i need a feedback.

      • u are a good instrutor

  • Iamhuman

    sudda bokka

  • mohsen moaddel

    how to configure ospf in wan ?

  • Husein

    like if i want to configure 5 routers in the same network so how can i configure ospf to work between 5 routers simualtenaously to work together and able to ping each other please i need a feedback.

  • Palak

    Plzz give me steps to create OSPF routing protocol for Cisco