OSPF configuration with multiple area

OSPF Configuration with Multiple Area:-



Configuration of interface

R1(config)# int f0/0
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if# no shutdown

R2(config)# int f0/0
R2(config-if)# ip address 192.168.1.2 255.255.255.0
R2(config-if# no shutdown

R2(config)# int f1/0
R2(config-if)# ip address 193.168.1.1 255.255.255.0
R2(config-if# no shutdown



R3(config)# int f1/0
R3(config-if)# ip address 193.168.1.2 255.255.255.0
R3(config-if# no shutdown


R3(config)# int f2/0
R3(config-if)# ip address 199.168.1.1 255.255.255.0
R3(config-if# no shutdown

R4(config)# int f2/0
R4(config-if)# ip address 199.168.1.2 255.255.255.0
R4(config-if# no shutdown


Configuration of Loop back:-

R1(config)#int loopback 1
R1(config-if)#  ip address 10.10.1.1 255.255.255.0
R1(config-if)#  int loopback 2
R1(config-if)#  ip address 10.10.2.1 255.255.255.0
R1(config-if)#  int loopback 3
R1(config-if)#  ip address 10.10.3.1 255.255.255.0
R1(config-if)#  int loopback 4
R1(config-if)#  ip address 10.10.4.1 255.255.255.0

R2(config)#int loopback 1
R2(config-if)#  ip address 20.20.1.1 255.255.255.0
R2(config-if)#  int loopback 2
R2(config-if)#  ip address 20.20.2.1 255.255.255.0
R2(config-if)#  int loopback 3
R2(config-if)#  ip address 20.20.3.1 255.255.255.0
R2(config-if)#  int loopback 4
R2(config-if)#  ip address 20.20.4.1 255.255.255.0

R3(config)#int loopback 1
R3(config-if)#  ip address 30.30.1.1 255.255.255.0
R3(config-if)#  int loopback 2
R3(config-if)#  ip address 30.30.2.1 255.255.255.0
R3(config-if)#  int loopback 3
R3(config-if)#  ip address 30.30.3.1 255.255.255.0
R3(config-if)#  int loopback 4
R3(config-if)#  ip address 30.30.4.1 255.255.255.0

R4(config)#int loopback 1
R4(config-if)#  ip address 40.40.1.1 255.255.255.0
R4(config-if)#  int loopback 2
R4(config-if)#  ip address 40.40.2.1 255.255.255.0
R4(config-if)#  int loopback 3
R4(config-if)#  ip address 40.40.3.1 255.255.255.0
R4(config-if)#  int loopback 4
R4(config-if)#  ip address 40.40.4.1 255.255.255.0

Configuration OSPF Protocol


R1(config)#router ospf 1
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#network 10.10.0.0 0.0.255.255 area 0

R2(config)#router ospf 2
R2(config-router)#network 192.168.1.0 0.0.0.255 area 0
R2(config-router)#network 193.168.1.0 0.0.0.255 area 1
R2(config-router)#network 20.20.0.0 0.0.255.255 area 0

R3(config)#router ospf 3
R3(config-router)#network 193.168.1.0 0.0.0.255 area 1
R3(config-router)#network 199.168.1.0 0.0.0.255 area 2
R3(config-router)#network 30.30.0.0 0.0.255.255 area 0

R4(config)#router ospf 4
R4(config-router)#network 199.168.1.0 0.0.0.255 area 2
R4(config-router)#network 40.40.0.0 0.0.255.255 area 0


Now check route and OSPF database table

R1(config)# show ip route




R2(config)# show ip route



R3(config)# show ip route




NOTE:- Router 3  do not share all route to Router 4 because  area 2 router do not connect directly or indirectly with area 0




R4(config)# show ip route



All areas in an OSPF autonomous system must be physically connected to the backbone area (area 0). In some cases where this physical connection is not possible, you can use a virtual link to connect to the backbone through a non-backbone area.

Connect to backbone to no-backbone area

Step:-1 router ID of router 2 use as virtual link in area 2

Step:-2 router ID of router 3 use as virtual link in area 1


Router 2



Router 3





Now Use command Virtual link 

R2(config)#router ospf 2
R2(config-router)#area 2 virtual-link 30.30.3.1
R3(config)#router ospf 3
R3(config-router)#area 1 virtual-link 20.20.4.1



Now router Got all route from Router 3






Troubleshooting Command


Router#show ip route 
Router#show ip ospf database
Router# show ip ospf Database Summary
Router# show ip ospf protocol
Router# show ip ospf neighbor
Router# show ip ospf 
Router# show ip ospf border-routers





6 comments: