OSPF Protocol Configuration

 

 

 

OSPF Protocol Configuration

 

 

 ________________________________________

Follow us on Facebook

Follow us on Google+

________________________________________

 

 

OSPF (Open Shortest Path First):


 OSPF Open Shortest Path First  is a link-state routing protocol that was developed in 1991.  In 1998, The current version of OSPF for IPv4 is OSPFv2 introduced in RFC 1247 and updated in RFC 2328 by John Moy. In 1999, OSPFv3 for IPv6 was published in RFC 2740.
OSPF was developed as a replacement for the distance vector routing protocol RIP. It operates as a classless routing protocol that uses the concept of areas for network scalability. RFC 2328 defines the OSPF metric as an arbitrary value called cost. The Cisco IOS uses bandwidth as the OSPF cost metric.
OSPF's major advantages over RIP are its fast convergence and its scalability to much larger network implementations.
OSPF has a default administrative distance of 110. As a classless routing protocol, it does not use a Transport layer protocol, as OSPF packets are sent directly over IP. 



OSPF Hello Packets:

 The OSPF Hello packet is used to establish neighbor adjacencies. By default, OSPF Hello packets are sent :

i.  Every 10 seconds on multi-access and point-to-point segments
ii. Every 30 seconds on non-broadcast multi-access (NBMA) segments (Frame Relay, X.25, ATM).

OSPF Dead Intervals:

OSPF dead interval is measured as the period of time an OSPF router will wait before terminating adjacency with a neighbor. The Dead interval is four times the Hello interval, by default.
 i. For multi-access and point-to-point segments, this period is 40 seconds.
ii. For NBMA networks, the Dead interval is 120 seconds.
For routers to become adjacent, their Hello interval, Dead interval, Network types and subnet masks must match. 
 

OSPF Router IDs :

The OSPF router ID is used to exclusively identify each router in the OSPF routing domain. Cisco routers derive the router ID based on three criteria and with the following preference:
1. the Use of the IP address configured with the OSPF router ID command.
2. If the router ID is not configured, the router chooses highest IP address of any of its loopback interfaces.
3. If no loopback interfaces are configured, the router chooses highest active IP address of any of its physical interfaces.

OSPF Area IDs:

 
The area ID refers to the OSPF network domain area. An OSPF area is a group of routers that share link-state information. All OSPF routers in the same domain area must have the same link-state information - received from neighbours - in their link-state databases.  In a typical OSPF design, routers are connected to a backbone called area 0 or backbone area.OSPF design must have a backbone area and other routers must connect to this area.







Open Shortest Path First (OSPF) is a popular routing protocol for IP networks for several key reasons:-
*   It is classless,
*   Offers full CIDR and VLSM support,

 *   It scales well, converges quickly, and guarantees loop free routing.
It also supports address summarization and the tagging of external routes, similar to EIGRP.

OSPF uses a large, dimensionless metric on every link - which can also be referred to as "cost - , with a maximum value of 65,535. It is important to remember that OSPF doesn't add these metrics the same way that RIP and EIGRP do. In those protocols, each router updates the total metric as it passes the route on to the next router. However, in OSPF, the routers distribute the individual link costs to one another. The maximum cost for an individual link, then, is 65,535. Any given path through an OSPF network can include many high-cost links, but still be usable. This is quite different from RIP, for example, where a few high-cost links along a path can make the entire path unusable.


 
 
 

How to Configure OSPF on a Network :

On this page we'll be looking at:
 
*   Configuring OSPF on a Network.
*   Creating a default Route in OSPF.
 
Configuring OSPF on a Network using the topology below. Note all router interface IP addresses had been configured appropriately.
 


 
HQ#config t
HQ(config-router)# router OSPF 1
HQ(config-router)#network 10.10.10.0 0.0.0.255 area 0
HQ(config-router)#network 172.16.10.0 0.0.0.3 area 0
HQ(config-router)#network 172.16.10.8 0.0.0.3 area 0
HQ(config-router)#end
 
All routers in the same network domain must be configured in the same manner.
You might notice the difference in the above configuration to that or RIP and EIGRP.
The OSPF process number is 1, The process number could be a any value between 1 to 65,535.
OSPF process number does not propagate outside of the area. Any value could be used. Also, you can use a different value for every router in an AS. Note that this is different from EIGRP, where every router in the AS must have the same process number.
Also, we used a wildcard mask or inverted subnet mask to define what range of network or hosts are permitted or deny access.
 

How to create a default Route in OSPF enabled Network :


You want to propagate a default route within an OSPF network.

Propagating a default route within OSPF, use the default-information originate configuration command:


HQ#configure terminal
HQ(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.2 
HQ(config)#router ospf 1
HQ(config-router)#default-information originate metric 30 metric-type 1
HQ(config-router)#end
HQ#
 
The above configuration enables OSPF to advertise a default route (0.0.0.0) into a normal area or destination network (172.16.10.2).
 
 
Troubleshooting and Verifying OSPF Configuration :
 
There are several ways you can verify and troubleshoot OSPF configuration and operation, listed below are the necessary command to do this:

How to verify OSPF Configuration:
Show IP route command
Show IP ospf command
Show ip ospf database command
Show ip ospf interface command
Show ip ospf neighbour command
Show ip protocols command
Debugging ospf


The Show IP route command:


R1#sho ip route
     10.0.0.0/30 is subnetted, 3 subnets
C       10.1.1.0 is directly connected, Serial0/0/1

O       10.10.10.0 [110/128] via 10.20.20.2, 00:05:14, Serial0/0/0
                   [110/128] via 10.1.1.2, 00:05:14, Serial0/0/1
C       10.20.20.0 is directly connected, Serial0/0/0
        172.16.0.0/24 is subnetted, 1 subnets
      172.16.10.0 [110/65] via 10.1.1.2, 00:05:14, Serial0/0/1
O       192.168.1.0/24 [110/65] via 10.20.20.2, 00:07:38, Serial0/0/0
C    192.168.20.0/24 is directly connected, FastEthernet0/0
R1#
Using the the above command displays all routes on the network, with the O representing the OSPF internal routes. The Cs are directly connected networks. It also found the dual route to the 10.10.10.0 network.
 



OSPF Protocol Configuration (video)