OSPF short for Open Shortest Path First is a Routing Protocol used to select the best suitable route for packets within the network. OSPF basically an open standard protocol and not relate to any particular vendor. OSPF propagate the changes to all networks more quickly as compared to RIP and IGRP protocols then only send the changed part of the routing table to the other routers within their area.
We can decrease the size of routing table by dividing a big network into logically small segment using its area feature. OSPF protocol check the availability of others routers in the network by sending Hello packets, if the other router does not respond then it is assumed to be dead router. When you used OSPF for single area configuration, its configuration method is slightly differs from the RIP and IGRP.
There are some common OSPF configuration and Executable commands:
OSPF configuration on Router A
In global configuration mode
Router-A(config) # router ospf 1 (Here 1 indicate the process identification number)
Router-A(config-Router) # network 20.0.0.0 0.255.255.255 area 0 (Here 20.0.0.0 indicate the network ID and 0.225.255.255 wildcard mask with area 0)
Router-A(config-Router) # network 40.0.0.0 0.255.255.255 area 1 (Here 40.0.0.0 indicate the network ID and 0.225.255.255 wildcard mask with area 1)
OSPF configuration on Router B
In global configuration mode
Router-B(config) # router ospf 1 (Here 1 indicate the process identification number)
Router-B(config-Router) # network 20.0.0.0 0.255.255.255 area 0 (Here 20.0.0.0 indicate the network ID and 0.225.255.255 wildcard mask with area 0)
Router-B(config-Router) # network 30.0.0.0 0.255.255.255 area 1 (Here 30.0.0.0 indicate the network ID and 0.225.255.255 wildcard mask with area 1)
Now on both routers each Network will be added automatically, you can ping to Router A and Router B to check communication. You can verify this on Router-A or Router-B by using command Router# ping 40.0.0.10 (ping for Router B) and Router # ping 30.0.0.20 (ping for router A).