CCN Expt 8 HK
CCN Expt 8 HK
___________________________________________________________________
EXPERIMENT NO. 8
OSPF
AIM: Create a virtual network using Cisco Packet Tracer & configure Open Shortest Path
First(OSPF) on the routers.
THEORY: OSPF stands for Open Shortest Path First. OSPF is a link state open standard based
routing protocol. It was created in mid-1980. The Open Shortest Path First (OSPF) protocol is
a link state protocol that handles routing for IP traffic. Its newest implementation, version 2,
which is explained in RFC 2328, is an open standard. Open Shortest Path First (OSPF) is an
open standard (not proprietary) and it will run on most routers independent of make. Open
Shortest Path First (OSPF) uses the Shortest Path First (SPF) algorithm, developed by Dijkstra,
to provide a loop-free topology. Open Shortest Path First (OSPF) provides
fast convergence with triggered, incremental updates via Link State Advertisements (LSAs).
Open Shortest Path First (OSPF) is a classless protocol and allows for a hierarchical design
with VLSM and route summarization.
The main disadvantages of Open Shortest Path First (OSPF) are Open Shortest Path First
(OSPF) requires more memory to hold the adjacency (list of OSPF neighbors), topology (a link
state database containing all of the routers and their routes), and routing tables, Open Shortest
Path First (OSPF) requires extra CPU processing to run the SPF algorithm and Open Shortest
Path First (OSPF) is a complex routing protocol.
NETWORK DIAGRAM:
All routers are in OSPF Area 0. Note that the link between R2 and R1 is an Ethernet (10Mbit)
link. All other links are FastEthernet (100Mbit) interfaces.
We’ll start with the configuration between R2 and R3:
Name: Harshda Khairnar XIE ID: 202002015 Roll No: 26
___________________________________________________________________
R2(config)#router ospf 1
R2(config-router)# network 192.168.23.0 0.0.0.255 area 0
R3(config)#router ospf 1
R3(config-router) #network 192.168.23.0 0.0.0.255 area 0
The number “1” is a process ID and you can choose any number you like. It doesn’t matter and
if you want you can use a different number on each router.
The second step is to use the network command.
network 192.168.23.0 0.0.0.255
Wildcardmas 0 0 0 255
k
R3 and R2 have become neighbours. There’s another command we can use to verify that we
have become neighbours:
R3#show ipospfneighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.23.2 1 FULL/BDR 00:00:36 192.168.23.2 FastEthernet0/0
Name: Harshda Khairnar XIE ID: 202002015 Roll No: 26
___________________________________________________________________
R2#show ipospfneighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.23.3 1 FULL/DR 00:00:32 192.168.23.3 FastEthernet1/0
Show ipospfneighbor is a great command to see if your router has OSPF neighbors. When the
state is full you know that the routers have successfully become neighbors.
Each OSPF router has a router ID and we check it with the show ip protocols command:
R2#show ip protocols
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 192.168.23.2
R3#show ip protocols
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 192.168.23.3
Above you see the router ID of R2 and R3. They used their highest active IP address as the
router ID. Let’s create a loopback on R2 to see if the router ID changes…
R2(config)#interface loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.0
This is how you create a loopback interface. You can pick any number that you like it really
doesn’t matter.
R2#show ip protocols
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 192.168.23.2
The router ID still the same. We need to reset the OSPF process before the change will take
effect, this is how you do it:
R2#clear ipospf process
Reset ALL OSPF processes? [no]: yes
Use clear ipospf process to reset OSPF. Let’s see if there is a difference:
R2#show ip protocols
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 2.2.2.2
We can also change the router ID manually. Let me demonstrate this on R3:
R3#show ip protocols
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Name: Harshda Khairnar XIE ID: 202002015 Roll No: 26
___________________________________________________________________
R2#show ipospfneighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.13.1 1 FULL/BDR 00:00:31 192.168.12.1 Ethernet0/0
3.3.3.3 1 FULL/DR 00:00:38 192.168.23.3 FastEthernet1/0
R1#show ipospfneighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 1 FULL/BDR 00:00:33 192.168.13.3 FastEthernet1/0
2.2.2.2 1 FULL/DR 00:00:30 192.168.12.2 Ethernet0/0
R3#show ipospfneighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.13.1 1 FULL/DR 00:00:37 192.168.13.1 FastEthernet1/0
2.2.2.2 1 FULL/BDR 00:00:30 192.168.23.2 FastEthernet0/0
Name: Harshda Khairnar XIE ID: 202002015 Roll No: 26
___________________________________________________________________
Excellent our routers have become OSPF neighbours and the state is full which means they are
done exchanging information. Let’s check the routing tables:
R2#show ip route ospf
O 192.168.13.0/24 [110/2] via 192.168.23.3, 00:09:45, FastEthernet1/0
RESULT:
ROUTER 0
Name: Harshda Khairnar XIE ID: 202002015 Roll No: 26
___________________________________________________________________
ROUTER 1
Name: Harshda Khairnar XIE ID: 202002015 Roll No: 26
___________________________________________________________________
ROUTER 2
Name: Harshda Khairnar XIE ID: 202002015 Roll No: 26
___________________________________________________________________
CONCLUSION: