• How to Configure Single-Area OSPF on a Cisco Router


    When would you need this: When you need to setup dynamic routing.

    Special Requirements: None.


    OSPF is one of the most widely used dynamic routing protocols. Cisco's version of OSPF is compatible with non-Cisco routers. If your network is large, jump into Multiple-Area OSPF configuration. Single area OSPF is suitable for small-to-medium internetworks.

    Single area OSPF configuration is as follows:

    1. Since OSPF best route calculations relies solely on Bandwidth, you need to setup the bandwidth of the serial interface involved in the routing process using the following command on the interface:

    Router(config-if)#bandwidth XX

    where XX is the bandwidth of the connection in kilobytes.

    Remeber that this command does not change the actual bandwidth, it only changes the bandwidth being seen by the routing protocol for the purpose of best path calculation.

    2. Instruct the router to activate the OSPF routing process:

    Router(config)#router ospf YY

    where YY is the process number of OSPF. This process number is of local significance. It does not have to be the same on all routers.

    3. Instruct the router to advertise the directly-connected networks:

    Router(config-router)#network NNN.NNN.NNN.NNN WWW.WWW.WWW.WWW area 0


    NNN.NNN.NNN.NNN is the network ID of the directly connected network.

    WWW.WWW.WWW.WWW is the wildcard mask of the network address.

    Note: If you are not familiar with the wildcard mask, just invert the subnet mask and you will get the wildcard mask (ex: S/N Mask of becomes Wildcard Mask of, S/N Mask of becomes

    Since we are setting a single area OSPF, we will always use "area 0".

    4. Repeat step 3 for every network that is directly connected to the router.

    [sniplet adsense]

    If you finished the first fours steps on all the routers involved in the process, everything should work just fine. If you want to do more configuration, there are a few advanced steps to go through:

    * To change the selection process of the DR (Designated Router) and BDR (Backup Designated Router) use the following command to change the router's OSPF priority on a certain interface:

    Router(config)#ip ospf priority PP

    where PP is the priority (0-255) the router with the highest priority becomes the DR. A priority of 0 means that this router will never be elected as DR.

    * To restart the whole process of DR and BDR elections, use the command:

    Router#clear ip ospf process *

    * To change the cost of a certain link in the OSPF process, use the following command:

    Router(config-if)#ip ospf cost CC

    where CC is the suggested cost (0 to 65,535)


    You can use the following commands in troubelshooting:

    Router#show ip ospf

    Router#show ip ospf database

    Router#show ip ospf interface

    Router#show ip ospf neighbor

    Router#debug ip ospf events


    Read more about OSPF in the Router Geek Book: Guide to Cisco Routers Configuration

    Write a comment