Skip to content
Related Articles

Related Articles

Configure and Verify Single Area OSPFv2

View Discussion
Improve Article
Save Article
  • Last Updated : 22 Jun, 2022
View Discussion
Improve Article
Save Article

Open Shortest Path First (OSPF) is a link-state routing protocol that is used to find the distance between two endpoints of a network, as well as the best path between them and the routers in the network, which can be updated by the router itself using link-state information that it receives from other routers in the network on a regular basis or via multicasting procedures such as OSPF area 0 multicast messages, OSPF hello packets or router advertisements The RAs are sent out periodically by a router to advertise its capabilities and other information about the router’s neighbor routers in the OSPF areas. 

For more details, refer to the article Open Shortest Path First (OSPF).

Steps to Configure Single-Area OSPF Version 2:

Step 1: First, we have to create a network topology of the devices listed below:

S.NODevice NameModel NameQty.
1.PCPC

3

2.RouterPT-Router

3

3.CableAutomatic connecting cable

Null

 

Step 2: After creating the network topology we have to assign IPv4 addresses, subnet mask, and default gateway to Host (PCs) according to the IP addressing table given below.

IP Addressing Table of PCs

S.NoDevice NameIPv4 addressSubnet MaskDefault Gateway
1.PC0192.1681.3255.255.255.0192.168.1.1
2.PC1192.168.2.3255.255.255.0192.168.2.1
3.PC3192.168.3.3255.255.255.0192.168.3.1

To configure PCs follow these steps:

  • Click on PC0 then go to desktop.
  • Then, IP configuration, and there you’ll find IPv4 configuration.
  • Add IPv4 address, subnet mask, and default gateway according to the IP addressing table given above.
  • Repeat this procedure with PC1 and PC2 and configure all PCs.

Step 3:  Configuring Routers with IP addresses and default gateway.

IP addressing table for routers:

S.NODeviceInterfaceIPv4 AddressSubnet mask
1router0FastEthernet0/0192.168.1.1255.255.255.0
  Serial 2/0192.168.12.1255.255.255.252
  Serial 3/0192.168.13.1255.255.255.252
2router1FastEthernet0/0192.168.2.1255.255.255.0
  serial 2/0192.168.12.2255.255.255.252
  serial 3/0192.168.23.1255.255.255.252
3router2FastEthernet0/0192.168.3.1255.255.255.0
  serial 2/0192.168.13.2255.255.255.252
  serial 3/0192.168.23.2255.255.255.252
  • To configure router0, click on router0.
  • Go to config.
  • then configure the router0 with the help of the IP addressing table given above.
  • to make sure to turn on the port.
  • and repeat the same procedure with router1 and router2 and hence all of the devices will be configured.

Step 3: Configure OSPFv2 in a single area

Now we have to add commands to configure the routers to open the shortest path first

1. Router0

  • Type these commands in CLI of router0.
Router(config-if)#
Router(config-if)#router ospf 1
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 192.168.12.0 0.0.0.3 area 0
Router(config-router)#network 192.168.13.0 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#

Router(config)#int lo0
Router(config-if)#ip address 1.1.1.1 255.255.255.255
Router(config-if)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#copy run start
Destination filename [startup-config]? 
Building configuration...
[OK]

2. Router1

Router(config)#router ospf 1
Router(config-router)#network 192.168.2.0 0.0.0.255 area 0
Router(config-router)#network 192.168.12.0 0.0.0.3 area 0
Router(config-router)#network 192.168.23.0 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
Router(config)#int lo0
Router(config-if)#ip address 2.2.2.2 255.255.255.255
Router(config-if)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#copy run start
Destination filename [startup-config]? 
Building configuration...
[OK]

3. Router3

Router(config)#router ospf 1
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router(config-router)#network 192.168.13.0 0.0.0.3 area 0
Router(config-router)#network 192.168.23.0 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
Router(config)#int lo0
Router(config-if)#ip address 2.2.2.2 255.255.255.255
Router(config-if)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#copy run start
Destination filename [startup-config]? 
Building configuration...
[OK]

Step 4: Now we have to verify the network by executing these experiments we’ll send PDU packet from PC0 to PC1:

We will use the ping command to verify the network connection:

  • Click on PC0 and go to the command prompt.
  • Then, type ping 192.168.2.3.

 

Simulation Result:

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!