Recent Posts

Friday, 18 August 2017

OSPF Lab work

OSPF Configuration

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.



Assign IP address to PC0





Assign IP address to interfaces of routers

Four interfaces FastEthernet0/0, FastEthernet0/1, Serial 0/1/0 and Serial 0/1/1 of Router0 are used in this topology. By default interfaces on router are remain administratively down during the start up.
We need to configure IP address and other parameters on interfaces before we could actually use them for routing. Interface mode is used to assign the IP address and other parameters. Interface mode can be accessed from global configuration mode. Following commands are used to access the global configuration mode and then we have to move on to interface mode. From there we can configure the interface. Following commands will assign IP address on FastEthernet0/0 and FastEthernet0/1.


interface fastEthernet 0/0 command is used to enter in interface mode.
ip address 10.0.0.1 255.0.0.0 command would assign IP address to interface.
no shutdown command would bring the interface up.
exit command is used to return in global configuration mode.
Serial interface needs two additional parameters clock rate and bandwidth. Every serial cable has two ends DTE and DCE. These parameters are always configured at DCE end.
We can use show controllers interface command from privilege mode to check the cable’s end.

Fourth line of output confirms that DCE end of serial cable is attached. If you see DTE here instead of DCE skip these parameters.
Now we have necessary information let’s assign IP address to serial interfaces.


Router#configure terminal Command is used to enter in global configuration mode.
Router(config)#interface serial 0/0/0 Command is used to enter in interface mode.
Router(config-if)#ip address 192.168.0.1 255.255.255.252 Command assigns IP address to interface. For serial link we usually use IP address from /30 subnet.
Router(config-if)#clock rate 64000 In real life environment this parameter controls the data flow between serial links and need to be set at service provider’s end. In lab environment we need not to worry about this value. We can use any valid clock rate here.
Router(config-if)#bandwidth 64 Bandwidth works as an influences. It is used to influence the metric calculation of OSPF or any other routing protocol which uses bandwidth parameter in route selection process. Serial interface has default bandwidth of 1544Kbps. To explain, how bandwidth influence route selection process we will configure (64Kbps) bandwidth on three serial DCE interfaces of our network; R0’s Se0/0/0, R1’s Se0/0/1 and R2’s Se0/0/0.
Router(config-if)#no shutdown Command brings interface up.
Router(config-if)#exit Command is used to return in global configuration mode.
We will use same commands to assign IP addresses on interfaces of remaining routers.

Router 1


Router 2


Router 6


Router 5


Router 3


Router 4


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.


Configure OSPF in Routing Protocol


  • Enabling OSPF is a two steps process:-
  • Enable OSPF routing protocol from global configuration mode.
  • Tell OSPF which interfaces we want to include.

For these steps following commands are used respectively.

Router(config)# router ospf process ID
This command will enable OSPF routing protocol in router. Process ID is a positive integer. We can use any number from 1 to 65,535. Process ID is locally significant. We can run multiple OSPF process on same router. Process ID is used to differentiate between them. Process ID need not to match on all routers.
Router(config-router)# network IP_network_# [wildcard_mask] area [area number]
Network command allows us to specify the interfaces which we want to include in OSPF process. This command accepts three arguments network number, wildcard mask and area number.

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 point

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 don’t care about corresponding octet in network address

OSPF Configurations

Router 0



Router 1


Router 2


Router 6



Router 5

Router 4



Router 3



That’s 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.


We can check the output at the command prompt which receives all the packets send from one PC to another PC.
Great! We have successfully implemented OSFP routing in our network topology in packet tracer version 7.0.

No comments:

Post a Comment

Popular Posts