Learn how to configure OSPF routing protocol on cisco routers


This article is all about how to configure OSPF routing protocol on cisco routers. Here OSPF stands for Open Shortest Path First. OSPF is a routing protocol that uses a link state routing(LSR) algorithm and falls into the group of Interior Gateway Protocols(IGP’s) and these are operating within a single autonomous system (AS). OSPF is the most widely used IGP in the large enterprise network. Because other routing protocols like RIP and EIGRP having some limitations in it. Like RIP routing only works on 15 hop count if hope count is more than 15 then we can’t use RIP routing in that company and EIGRP routing protocol works only on cisco routers. But OSPF routing protocol is working on the other company routers and also work on more than 15 hop count in a company. So OSPF is the most widely used protocol in the large enterprise network.

OSPF is also famous among ISP network because it’s an open standard and supports almost every vendor hardware and software. So, let’s start here how to configure OSPF routing protocol on cisco routers.

Now to understand this whole process with ease we take a lab in cisco packet tracer. In this lab, we take four routers having serial ports in it and four PCs to check whether they are communicating properly or not using the ping command in it.

how to configure OSPF on routers

We do this whole lab in three parts in the first part we assign IP address on all the interfaces of the router. In the second part, we configure OSPF routing protocol on the routers to connect different networks in a company. In the third part, we use ping command and check whether they are communicating with each other or not.

Part 1: – Assign IP address on all the routers using given below command.

For router R1

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1

R1(config)#interface FastEthernet0/0

R1(config-if)#ip address 1.0.0.1 255.0.0.0

R1(config-if)#no shutdown

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

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

R1(config-if)#exit

R1(config)#interface Serial0/0/0

R1(config-if)#ip address 2.0.0.1 255.0.0.0

R1(config-if)#clock rate 64000

R1(config-if)#no shutdown

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

R1(config-if)#exit

 

For router R2

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R2

R2(config)#

R2(config)#interface FastEthernet0/0

R2(config-if)#ip address 3.0.0.1 255.0.0.0

R2(config-if)#no shutdown

R2(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

R2(config-if)#exit

R2(config)#interface Serial0/0/0

R2(config-if)#ip address 2.0.0.2 255.0.0.0

R2(config-if)#no shutdown

R2(config-if)#

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

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

R2(config-if)#exit

R2(config)#interface Serial0/0/1

R2(config-if)#ip address 4.0.0.1 255.0.0.0

R2(config-if)#clock rate 6400

R2(config-if)#no shutdown

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

R2(config-if)#exit

 

For router R3

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R3

R3(config)#interface FastEthernet0/0

R3(config-if)#ip address 5.0.0.1 255.0.0.0

R3(config-if)#no shutdown

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

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

R3(config-if)#exit

R3(config)#interface FastEthernet0/1

R3(config-if)#ip address 4.0.0.2 255.0.0.0

R3(config)#interface Serial0/0/0

R3(config-if)#no shutdown

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

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

R3(config-if)#exit

 

Part 2: – Configure OSPF routing on cisco routers using given below command

For router R1

R1(config)#route ospf 1

R1(config-router)#network 1.0.0.0 0.255.255.255 area 0

R1(config-router)#network 2.0.0.0 0.255.255.255 area 0

 

For router R2

R2(config)#route ospf 2

R2(config-router)#network 2.0.0.0 0.255.255.255 area 0

R2(config-router)#network 3.0.0.0 0.255.255.255 area 0

R2(config-router)#network 4.0.0.0 0.255.255.255 area 0

 

For router R3

R3(config)#route ospf 3

R3(config-router)#network 4.0.0.0 0.255.255.255 area 0

R3(config-router)#network 5.0.0.0 0.255.255.255 area 0

 

Part 3: – Use ping command on the PCs to check whether they are communicating with each other or not and also trace the route using tracert command on the PCs

PC>ping 5.0.0.2

Pinging 5.0.0.2 with 32 bytes of data:

Reply from 5.0.0.2: bytes=32 time=2ms TTL=125

Reply from 5.0.0.2: bytes=32 time=12ms TTL=125

Reply from 5.0.0.2: bytes=32 time=11ms TTL=125

Reply from 5.0.0.2: bytes=32 time=34ms TTL=125

Ping statistics for 5.0.0.2:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 2ms, Maximum = 34ms, Average = 14ms

 

PC>tracert 4.0.0.2

Tracing route to 4.0.0.2 over a maximum of 30 hops:

1 0 ms 0 ms 1 ms 1.0.0.1

2 15 ms 28 ms 37 ms 2.0.0.2

3 1 ms 0 ms 1 ms 4.0.0.2

Trace complete.

 

PC>tracert 1.0.0.1

Tracing route to 1.0.0.1 over a maximum of 30 hops:

1 0 ms 0 ms 0 ms 5.0.0.1

2 1 ms 0 ms 14 ms 4.0.0.1

3 7 ms 35 ms 7 ms 1.0.0.1

Trace complete.

                                             THAT’S IT

This is the whole process by which we can easily configure OSPF (Open Shortest Path First) routing protocol on the routers. In next article, we learn how to troubleshoot OSPF routing protocol. If you have any queries regarding this then simply solved out through the comment section and also provide feedback to us. Because your feedback is valuable for us.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s