OSPF Configuration Step by Step Guide
OSPF Configuration Step by Step Guide
In this tutorial we will provide a step by step configuration guide for OSPF
routing protocol. OSPF uses the concept of process ID, area number and
Wildcard mask which makes its configuration a little bit more complex. We
will explain these fundamental topics in easy language with examples.
This tutorial is the fourth part of our article OSPF Routing Protocol Explained
with examples". You can read other parts of this article here.
OSPF Fundamental Terminology Explained
This tutorial is the first part of this article. In this part we explained basic
terminology of OSPF such as Feature , Advantage and Disadvantage,
Autonomous System, Area concept, ABR, IR, Link, State ,LSA and LSDB with
example.
OSPF Neighborship Condition and Requirement
This tutorial is the second part of this article. OSPF neighborship is built
between two routers only if configuration value of Area ID, Authentication,
Hello and Dead interval, Stub Area and MTU are matched. This part explains
these parameters and OSPF adjacency in detail with examples.
OSPF Neighbor States Explained with Example
This tutorial is the third part of this article. OSPF adjacency process goes
through the seven states; OSPF State down, OSPF State Init, OSPF State
two ways, OSPF State Exstart, OSPF State Exchange, OSPF State Loading
and OSPF State full. This part explains these states with DR BDR selection
process in detail with examples.
OSPF Metric cost Calculation Formula Explained
This tutorial is the last part of this article. In this part we will explain OSPF
metric component bandwidth, Delay, Load, Reliability and MTU with cost
calculation formula in detail with examples.
For demonstration we will use packet tracer network simulator software. You
can use real Cisco devices or any other network simulator software for
following this guide.
Create a topology as illustrate in following figure or download this pre-
created topology.
Download OSPF Practice Topology
Device Interface IP Configuration Connected with
Assign IP address to PC
Double click PC0 and click Desktop menu item and click IP Configuration.
Assign IP address 10.0.0.2/8 to PC0.
Router2
Router3
Router4
Great job we have finished our half journey. Now routers have information
about the networks that they have on their own interfaces. Routers will not
exchange this information between them on their own. We need to
implement OSPF routing protocol that will insist them to share this
information.
To be on same track I have uploaded my practice topology. Use this if you
want to skip above IP configuration part.
Download OSPF Practice Topology with IP configuration
Network number
Network number is network ID. We can use any particular host IP address or
network IP address. For example we can use 192.168.1.1 (host IP address)
or we can use 192.168.1.0 (Network IP address). While targeting a specific
interface usually we use host IP address (configured on that interface).
While targeting multiple interfaces, we use network IP address. So any
interface that belongs to specified network ID will be selected.
Wildcard mask
Wildcard mask are used with network ID to filter the interfaces. Wildcard
mask is different from subnet mask. Subnet mask is used to separate the
network portion and host portion in IP address. While wildcard mask is used
to match corresponding octet in network portion. Wildcard mask tells OSPF
the part of network address that must be matched. Wildcard masks are
explained with examples in access list tutorials of this category.
Key points
0 (Decimal octet format) Wildcard mask indicates that corresponding
octet in network address must be matched exactly.
255 (Decimal octet format) Wildcard mask indicates that we dont care
about corresponding octet in network address.
For example
0 (Binary bit format) Wildcard mask indicates that corresponding bit in
network address must be matched exactly.
255 (Binary bit format) Wildcard mask indicates that we dont care
about corresponding bit in network address.
OSPF configuration
Router0
Router1
Router2
Router6
Router5
Router4
Router3
Thats it. Our network is ready to take the advantage of OSPF routing. To
verify the setup we will use ping command. ping command is used to test
the connectivity between two devices. We have two routes between source
and destination. tracert command is used to know the route which is used to
get the destination.
Access the command prompt of PC1 and use ping command to test the
connectivity from Server0. After that use tracert command to print the
taken path.
Great! We have successfully implemented OSFP routing in our network. For
cross check we have uploaded a configured topology on our server. You can
use that if not getting same output.
Download OSPF Practice Topology with OSPF configuration
Summary
Command Description
Router(config-if)#ip ospf priority Used to influence DR/BDR selection process. Valid range is 0 to
100 255. 0 makes router ineligible for DR/BDR while 255 makes router
guaranteed DR/BDR. Higher priority value means higher chance of
becoming DR/BDR.
Router(config-if)#bandwidth 256 Used to influence route metric cost. Cost is the inverse of bandwidth.
Higher bandwidth has lower cost. Bandwidth is defined in Kbps. 256
means 256 Kbps.
Router(config-if)#ip ospf hello- Set hello interval timer to 15 seconds. Hello timer must be match on
interval timer 15 both routers in order become neighbors.
Router(config-if)#ip ospf dead- Set dead interval timer to 60 seconds. Dead interval timer must be
interval 60 match on both routers in order to become neighbor
Router#show ip route ospf Display all routers learned through OSPF from routing table
Router#show ip ospf interface Display information about all OSPF active interfaces
Router#show ip ospf interface Display OSPF information about serial 0/0/0 interface
serial 0/0/0