Home » Networking » How To Configure OSPF Routing In CISCO router

How To Configure OSPF Routing In CISCO router

Introduction of OSPF:

Open Shortest path first (OSPF) is a routing protocol for internet network. It is basically a dynamic routing protocol.
OSPF is an Interior Gateway Protocol (IGP) for routing. OSPF supports internet version 4 and internet version 6 network and also use Variable Length Subnet Mask (VLSM) and classless intra domain routing (CIDR) in the tropologies. It computes the shortest path for routing by the help of Dijkstra’s Algorithm,it is a shortest path fast algorithm. OSPF does not use a TCP/IP transport protocol, such as UDP or TCP, but encapsulates its data in IP datagrams with protocol number 89.This is in contrast to other routing protocols, such as the Routing Information Protocol (RIP) and the Border Gateway Protocol (BGP). OSPF implements its own error detection and correction functions.
NOW SEE HOW TO CONFIGURE THIS OSPF ROUTING IN PHYSICAL NETWORK:
ospf

Here we create the routing between three network such as 172.16.0.0/16,172.17.0.0/16, and 172.18.0.0/16 networks.

PROCEDURE:
Firstly open the cisco packet tracer software. Then choose the routers,computers and servers which is shown in the figure. After that you may assign the ip address to the fast ethernet and serial interfaces. After that advertise the network in the routing table, now i am showing you the configurations of each routers:

ROUTER 1
ip addresses for different interfaces:
fa0/0 -> 172.16.0.1 255.255.0.0 class B
se0/0 ->192.168.2.1 255.255.255.0 class C with clock rate 9600 and bandwidth 100
se0/1 ->192.168.1.1 255.255.255.0 class C with clock rate 9600 and bandwidth 100
OSPF process id ->10 and Area -> 0

CONFIGURATION IN ROUTER :


Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip address 172.16.0.1 255.255.0.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#int se0/0
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#clock rate 9600
Router(config-if)#bandwidth 100
Router(config-if)#no shut
Router(config-if)#int se0/1
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#clock rate 9600
Router(config-if)#no shut
Router(config-if)#end
Router#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 172.16.0.0/16 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Serial0/1
C 192.168.2.0/24 is directly connected, Serial0/0
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 10
Router(config-router)#network 172.16.0.0 255.255.0.0 area 0
Router(config-router)#network 192.168.1.0 255.255.255.0 area 0
Router(config-router)#network 192.168.2.0 255.255.255.0 area 0
Router(config)#wr

ROUTER 2
ip addresses for different interfaces:
fa0/0 -> 172.17.0.1 255.255.0.0 class B
se0/0 ->192.168.1.2 255.255.255.0 class C with clock rate 9600 and bandwidth 100
se0/1 ->192.168.3.2 255.255.255.0 class C with clock rate 9600 and bandwidth 100
OSPF process id ->10 and Area -> 0

CONFIGURATION IN ROUTER :

Router> en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip address 172.17.0.1 255.255.0.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#int se0/0
Router(config-if)#ip address 192.168.1.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
Router(config-if)#int se0/1
Router(config-if)#ip address 192.168.3.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up
Router(config-if)#^Z
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 172.17.0.0/16 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Serial0/0
C 192.168.3.0/24 is directly connected, Serial0/1
Router(config)#router ospf 10
Router(config-router)#network 172.17.0.0 255.255.0.0 area 0
Router(config-router)#network 192.168.1.0 255.255.255.0 area 0
Router(config-router)#network 192.168.3.0 255.255.255.0 area 0
Router(config-router)#^Z
Router#

ROUTER 0
ip addresses for different interfaces:
fa0/0 -> 172.18.0.1 255.255.0.0 class B
se0/0 ->192.168.2.2 255.255.255.0 class C with clock rate 9600 and bandwidth 100
se0/1 ->192.168.3.1 255.255.255.0 class C with clock rate 9600 and bandwidth 100
OSPF process id ->10 and Area -> 0

CONFIGURATION IN ROUTER :


Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip address 172.18.0.1 255.255.0.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#int se0/0
Router(config-if)#ip address 192.168.2.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
Router(config-if)#int
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to
Router(config-if)#int se0/1
Router(config-if)#ip add 192.168.3.1 255.255.255.0
Router(config-if)#clock rate 9600
Router(config-if)#bandwidth 100
Router(config-if)#no shut
Router(config-if)#
Router(config-if)#router ospf 10
Router(config-router)#network 172.18.0.0 255.255.0.0 area 0
Router(config-router)#network 192.168.2.0 255.255.255.0 area 0
Router(config-router)#
Router#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
O 172.16.0.0/16 [110/65] via 192.168.2.1, 00:03:04, Serial0/0
O 172.17.0.0/16 [110/1001] via 192.168.3.2, 00:48:01, Serial0/1
C 172.18.0.0/16 is directly connected, FastEthernet0/0
O 192.168.1.0/24 [110/1064] via 192.168.2.1, 00:03:04, Serial0/0
[110/1064] via 192.168.3.2, 00:03:04, Serial0/1
C 192.168.2.0/24 is directly connected, Serial0/0
C 192.168.3.0/24 is directly connected, Serial0/1
Router#

NOW CHECK THE CONNECTION IF THE ROUTING ESTABLISHED OR NOT:

Router#ping 172.17.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/5/13 ms
Router#ping 172.18.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.18.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 7/10/15 ms

THANK YOU.

For any query you may write in the comment box.

Check Also

Configure OpenVPN in pfSence router OS

pfSense is well known router OS for its simplicity and wide options to  take control over …

Leave a Reply

Your email address will not be published. Required fields are marked *