What is the OSPF Protocol? Why do we need to use OSPF in the network?

(OSPF) stands for OPen Shortes Path First, and it’s a protocol that enables the router can exchange information on the network. The article will show you step by step how to configure OSPF Single Area Network.

Step 1: Basic configuration PC and Router

One Router1

Router#config t
Router(config)#hostname R1
R1(config)#int gi0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh

R1(config-if)#int s0/0/0
R1(config-if)#ip add 172.16.1.1 255.255.255.252
R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

================================================================


One Router 2

Router>en
Router#config t
Router(config)#hostname R2
R2(config)#int gi0/0
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

R2(config-if)#int s0/0/1
R2(config-if)#ip add 172.16.1.5 255.255.255.252
R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to up

R2(config-if)#int s0/0/0
R2(config-if)#ip add 172.16.1.2 255.255.255.252
R2(config-if)#no shutdown

================================================================

On Router 3

Router>en
Router#config t
Router(config)#hostname R3
R3(config)#int gi0/0
R3(config-if)#ip add 192.168.3.1 255.255.255.0
R3(config-if)#no shutdown

%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

R3(config-if)#int s0/0/0
R3(config-if)#ip add 172.16.1.6 255.255.255.252
R3(config-if)#no shutdown

================================================================

Step 2: Configuration OSPF on each Router

On Router 1

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 172.16.1.0 0.0.0.3 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#passive-interface gi0/0
R1#show running-config
R1#show ip protocols

On Router 2

R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 172.16.1.0 0.0.0.3 area 0
R2(config-router)#network 172.16.1.4 0.0.0.3 area 0
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
R2(config-router)#passive-interface gi0/0
R2#copy running start
R2#show running-config
R2#show ip protocols

On Router 3

R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 172.16.1.4 0.0.0.3 area 0
R3(config-router)#network 192.168.3.0 0.0.0.255 area 0
R3(config-router)#passive-interface gi0/0
R3(config-router)#

Step 3: Test connection between PC1 & PC2 to PC3 with successfull result.

A. Ping from PC1 to PC3 use command “ping 192.168.3.30 “

B. Ping from PC2 to PC3 use command “ping 192.168.3.30 ”

Lab file is taken from netacad.com

By Admin