This lab will discuss and demonstrate the configuration and verification of
If you’ve completed the labs in the Free CCNA Workbook up until this point then boy you’re in for a real treat. Free CCNA Workbook has saved the best for last. Open Shortest Path First (Aka: OSPF)
OSPF is the industry standard in internal dynamic routing protocols and it’s supported on nearly all vendor platforms. So what makes OSPF so special? It’s really the functionality and the hierarchical nature of the protocol in which it fits perfectly with modern networks.
However; in general, OSPF is a very large technological and configurational protocol. Meaning that there are books dedicated to OSPF design, implementation and configuration with 500+ pages but for the CCNA you’ll just need to know the basics which include in summary; single and multi-area configuration, link priority, DR/BDR Election, OSPF network types, stub area types, timers, default route propagation, route summarization and Link State Advertisements (LSA) Types. etc…
So with all that being said lets take a dive into the technological pool of OSPF…
OSPF is a link state protocol and each router maintains a topology map of their configured area; however routers in Area 0 maintain the topology for the entire network, in which case backbone routers know of every single link and route. Just because a backbone router knows about the link does not necessary mean the router will use that link in the routing table. Many factors can take into play to manipulate the “best path” such as a distribute list, route maps or policy based routing.
OSPF was designed to support Variable Length Subnet Masking (VLSM) and a hierarchical network model by nature. All traffic destined between areas, also known as inter-area traffic must traverse area 0 which is called the backbone area. All area’s must have a single interface attaching the area to area 0. Routers that have these connections to Area 0 are called Area Boarder Router(s) (ABR’s). Any routers that connect an area to an external autonomous system are called Autonomous System Boundary Router(s), (ASBR’s). These routers connect OSPF to an external network such as the internet or a redistributed autonomous system.
OSPF does not use TCP/UDP to encapsulate its traffic but instead encapsulates the traffic into its own protocol; protocol number 89. OSPF sends multicast traffic packets have a TTL of 1 so they never travel further then 1 hop. OSPF uses the destination addresses 126.96.36.199 for all OSPF routers and 188.8.131.52 for communication between the DR/BDR (Designated Router and Backup Designated Router).
In OSPF, you can only summarize routes at an ABR/ASBR on the link facing the inbound towards the network.
OSPF uses a centralized management method of distributing route updates on networks. On multi-access networks such as Ethernet or frame relay point-to-multipoint, a Designated router and potentially backup designated router is elected. The function of the DR is to distribute updates to the other routers connected on the multi-access network. The Backup Designated Router will take over the Designated roll if the DR fails. So with that said, If R1 is the DR then R2 could be the BDR and when a link on R3 goes down it informs R1 which in turn informs all other routers on the multi-access network segment.
The DR/BDR election winner is determined by one of several factors, whichever breaks the tie. OSPF Interface Priority takes precedence. By default all interfaces send hello packets with an OSPF priority of 1. If an interface has the OSPF interface priority of 0 then that router will never become the DR/BDR for that particular network segment. If all OSPF interface priorities match then the highest router ID wins. The Router-ID can be statically configured under the OSPF routing process configuration mode or it is dynamically determined by the highest IP address of a loopback interface. If no loopback interfaces exist on the router then the highest IP address of an active interface becomes the router-id for OSPF. For example; 192.168.0.1/24 is higher then 10.0.0.1/24
If a router comes online with a higher priority/router-id then that router will not preempt the DR/BDR role but will have to wait until a role change. DR or BDR failure. The Router Priority ranges between 0-255.
The DR’s purpose is to provide a central source for routing updates and to reduce traffic. All routers form a neighbor relationship with the DR/BDR but not between DROTHER’s (Non DR or BDR Routers)
DR/BDR routers are not elected on point-to-point networks as there are only two routers on the link. A DR/BDR is also not elected on a point-to-multipoint network type due to OSPF treating the network type as a collection of point-to-point interfaces.
Take note of the following OSPF Interface Types;
For the CCNA exam you are required to know the six Link State Advertisement types listed below;
|LSA Number||LSA Name||Description|
|Type 1||Router LSA||Generated by all routers in an area and list the directly connected networks; this specific LSA do not transit the ABR/ASBR into other areas.|
|Type 2||Network LSA||Generated by the DR on a multi-access network such as Ethernet to identify all routers to that network segment. This LSA type is flooded through out the local area only. Both Type 1 and Type 2 LSA’s advertise Intra-Area routes denoted as (O) Routes in the routing table.|
|Type 3||Summary LSA||Generated by the ABR to describe summary routes to neighboring routers outside of the Area such as an Area 1 ABR summarizing the 10.20.0.0/12 network to Area 0.|
|Type 4||Summary LSA||Generated by an ABR to describe route(s) to an ASBR to outside neighboring routers. For example an ABR telling Area 0 that an ASBR is located inside Area 1. LSA’s Type 3 and 4 advertise Inter-Area routes; denoted as (O*IA) routes in the routing table.|
|Type 5||External LSA||Generated by an ASBR to describe routes towards an external network such as redistributed networks. These routes are denoted as (O*E#) Routes in the routing table.|
|Type 7||NSSA External LSA||Generated by an ASBR in an Not-So-Stubby-Area which describes a route to an external network. These LSA’s are sent to the ABR which in turn translates these LSA’s to Type 5 to be sent into the Backbone area. These routes are denoted as (O*N#) Routes in the routing table.|
After having an understanding of the LSA types you must memorize the operations of different OSPF Area types as listed below;
|Area Type||Description and/or Function|
|Backbone Area||Permits all LSA types except Type 7. This same rule applies to non-backbone, non stub area routers.|
|Stub Area||An area that has a single exit point and blocks type 5 LSA types and receives type 3/4 LSA’s with a default route (0.0.0.0/0)|
|Not-So-Stubby-Area (NSSA)||This area allows for a stub area to have characteristics of a stub and non stub. External routes redistributed into the OSPF autonomous system by am NSSA advertising an LSA type 7 which is translated at the ABR to type 5 and forwarded into the OSPF backbone.|
|Totally Stubby Area||Permits type 1 and 2 LSA’s while blocking types 3*/4/5/7 LSA’s. *TSA’s receive a single type 3 LSA containing a default route to the ABR.|
|Totally NSSA||Is an area that permits LSA’s 1, 2 and 7 while blocking 3 4 and 5. This stub area receives a default route from the ABR using a type 3 LSA.|
Okay so enough with all the technology stuff, its time to get to the configuration!!!
Just like the previous dynamic routing protocols you’ll need to enable OSPF by executing the router ospf process-id# command in global configuration. The process id number is a locally significant process identification number and this does not need to match neighboring routers.
As previously stated; OSPF was designed to used VLSM so there is no auto-summarization to disable.
To specify which interfaces participate in the OSPF routing process you’ll use the network ip.ip.ip.ip wc.wc.wc.wc area # in OSPF router configuration mode where ip is the network ip and wc is the wildcard mask followed by the area in which that network belongs in. For example; network 10.90.23.1 0.0.0.0 area 23
Keep in mind the default OSPF network type on a frame-relay interface is non-broadcast, in which case static neighbors have to be defined. For this lab you’ll need to change this to broadcast using the ip ospf network-type broadcast command the frame relay interfaces. The ip ospf network-type network-type is issued on a per interface basis.
To view OSPF neighbors use the show ip ospf neighbors command. You can view information relating to interfaces participating in ospf by using the show ip ospf interface command.
In this lab you will configure the frame-relay interfaces on R1, R2, R4 and R5 to participate in OSPF area 0.
Familiarize yourself with the following new command(s);
|router ospf proc-id#||This command is executed in OSPF router configuration mode to specifiy which networks paticipate in the OSPF routing protocol and in which area they belong to.|
|network ip.ip.ip.ip wc.wc.wc.wc area #||This command is executed in OSPF router configuration mode to specifiy which networks paticipate in the OSPF routing protocol and in which area they belong to.|
|show ip ospf neighbor||This command is executed in privileged mode and displays a list of neighbor relationships.|
|clear ip ospf proc-id proc||This command clears the OSPF process completely and rebuilds all neighbor relationships and re-learns all routes when executed in privileged mode.|
|show ip ospf database||This command is executed in privileged mode and displays all entries in the routers OSPF database by LSA type.|
|ip ospf network network-type||This command is executed in interface configuration mode and displays and configures the a specific network type on a per-interface basis.|
The following logical topology shown below is used in labs found through out Section 9 – Configuring OSPF;
Objective 1. – Configure OSPF Area 0 on R1, R2, R4 and R5’s frame-relay hub-and-spoke interfaces.
R1>enable R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#router ospf 1 R1(config-router)#network 10.90.245.1 0.0.0.0 area 0 R1(config-router)#end R1#
R2>enable R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router ospf 1 R2(config-router)#network 10.90.245.2 0.0.0.0 area 0 R2(config-router)#end R2#
R4>enable R4#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R4(config)#router ospf 1 R4(config-router)#network 10.90.245.4 0.0.0.0 area 0 R4(config-router)#end R4#
R5>enable R5#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R5(config)#router ospf 1 R5(config-router)#network 10.90.245.5 0.0.0.0 area 0 R5(config-router)#end R5#
Objective 2. – Configure the OSPF broadcast network type on R1, R2, R4 and R5’s frame relay hub and spoke interfaces.
Due to the nature of OSPF, the default interface type for a frame relay interface is non-broadcast, in which case static neighbors must de defined. However configuring static neighbors will be discussed in the next lab. To fix this problem change the network type of the frame-relay interfaces to broadcast to allow for dynamic neighbor discovery as shown below;
R1>enable R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#interface Serial0/0 R1(config-if)#ip ospf network broadcast R1(config-if)#end R1#
R2>enable R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#interface Serial0/0 R2(config-if)#ip ospf network broadcast R2(config-if)#end %OSPF-5-ADJCHG: Process 1, Nbr 10.90.10.1 on Serial0/0 from LOADING to FULL, Loading Done R2#
R4>enable R4#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R4(config)#interface Serial0/0 R4(config-if)#ip ospf network broadcast R4(config-if)#end %OSPF-5-ADJCHG: Process 1, Nbr 10.90.10.1 on Serial0/0 from LOADING to FULL, Loading Done R4#
R5>enable R5#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R5(config)#interface Serial0/0 R5(config-if)#ip ospf network broadcast R5(config-if)#end %OSPF-5-ADJCHG: Process 1, Nbr 10.90.10.1 on Serial0/0 from LOADING to FULL, Loading Done R5#
Objective 3. – Verify that the spoke routers (R2, R4 and R5) have formed an adjacency with the hub router; R1.
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 10.90.20.1 1 FULL/DROTHER 00:00:33 10.90.245.2 Serial0/0 10.90.40.1 1 FULL/DROTHER 00:00:31 10.90.245.4 Serial0/0 10.90.50.1 1 FULL/BDR 00:00:35 10.90.245.5 Serial0/0 R1#
As you can see from the neighbor table, R2 and R4 have become DROTHERS (non DR/BDR routers) and R5 has become the Backup Designated Router (BDR). As discussed in the core knowledge section the Neighbor ID (Router-ID) is derived from the statically configured ospf router-id or the highest ip address of a loopback interface or the highest ip address of a directly connected interface. Whichever comes first.
In a frame relay hub and spoke environment you ALWAYS need to have the hub router become the Designated Router (DR) due to the way OSPF operates. Think back to the core knowledge where you read that OSPF sends hello’s and updates using multicast with a TTL of only 1. This means that the traffic will not go further then one hop. So with this in mind lets say R2 became the DR and R5 wanted to send an update, it would have to send it to R5 but to get to R5 it would traverse R1 in which case the TTL would decrement to 0 and the packet would be dropped.
In the next lab you’ll learn how to configure the OSPF interface priority to ensure that R1 always becomes the DR and R2, R4 and R5 do not become the DR or BDR.