3
OSPF-Open Short Path First,It is a Open Standard Routing Protocol

Link State Routing Protocol
Algorithm -Dijkistra,To find shortest path
Administrativ Distance-110
Metric- 10^8/Bandwidth
Incremental Update
Load Balancing Maximum 6 (Default 4)
It knows Network topology
Router ID-
Initializes OSPF Process
Fast convergence


Timers

Hello-10
Dead-40
Wait-40
Retransmit-5


OSPF Configuration with Multiple Area and Using Virtual Link to Connect Area



Step 1:Create topology like below i have given

How to configure Ospf Routing Protocol and Connect Areas

Step 2:Cofigure ip addres to all interfaces






In Router R1,

R1(config)#interface fastethernet 2/0
R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#exit


R1(config)#interface serial 1/0
R1(config-if)#ip address 20.0.0.1 255.0.0.0
R1(config-if)#encapsulation ppp
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#exit


In Router R2,

R2(config)#interface serial 1/0
R2(config-if)#ip address 20.0.0.2 255.0.0.0
R2(config-if)#encapsulation ppp
R2(config-if)#no shutdown
R2(config-if)#exit


R2(config)#interface serial 1/1
R2(config-if)#ip address 30.0.0.1 255.0.0.0
R2(config-if)#encapsulation ppp
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown
R2(config-if)#exit


In Router R3,

R3(config)#
R3(config)#interface serial 1/0
R3(config-if)#ip address 30.0.0.2 255.0.0.0
R3(config-if)#encapsulation ppp
R3(config-if)#no shutdown
R3(config-if)#exit


R3(config)#
R3(config)#interface fastethernet 2/0
R3(config-if)#ip address 40.0.0.1 255.0.0.0
R3(config-if)#no shutdown
R3(config-if)#exit





Step 3:Now,Enable ip routing by configuring ospf routing protocol in all routers,


In Router R1,



 R1(config)#router ospf 1
 R1(config-router)#router-id 1.1.1.1
 R1(config-router)#network 10.0.0.0 0.255.255.255 area 3
 R1(config-router)#network 20.0.0.0 0.255.255.255 area 1
 R1(config-router)#exit

In Router R2,


R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 20.0.0.0 0.255.255.255 area 1
R2(config-router)#network 30.0.0.0 0.255.255.255 area 0
R2(config-router)#exit

In Router R3,


R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 30.0.0.0 0.255.255.255 area 0
R3(config-router)#network 40.0.0.0 0.255.255.255 area 2
R3(config-router)#exit




You have to configure router id when we configure ospf.It is used to identify the router







Step 4:Now check routing table of R1,


Router#show ip route
Codes: C - connected, S - static, 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
       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    10.0.0.0/8 is directly connected, FastEthernet2/0
C     20.0.0.0/8 is directly connected, Serial1/0
O IA 40.0.0.0/8 [110/129] via 20.0.0.2, 00:04:23, Serial1/0
O IA 30.0.0.0/8 [110/128] via 20.0.0.2, 00:07:29, Serial1/0




Here,R2 knows Area 0.Network 20.0.0.0 connected to R2 from R1,So R1 learns networks through this network.

R3(config)#router ospf 1, Here, 1 is Process ID, it can be 1-65535.It initializes ospf process.
         

There must be one interface up to keep ospf process up.So its better to configure loopback address to routers.It is a virtual interface never goes down once we configured.





R1(config-if)#interface loopback 0
R1(config-if)#ip add 172.16.1.252 255.255.0.0
R1(config-if)#no shutdown




R2(config-if)#interface loopback 0
R2(config-if)#ip add 172.16.1.253 255.255.0.0
R2(config-if)#no shutdown




R3(config-if)#interface loopback 0
R3(config-if)#ip add 172.16.1.254 255.255.0.0
R3(config-if)#no shutdown








Step 5:Now ,Check Routing table of R3,


R3#show ip route
Codes: C - connected, S - static, 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
       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 IA 20.0.0.0/8 [110/128] via 30.0.0.1, 00:18:58, Serial1/0
C    40.0.0.0/8 is directly connected, FastEthernet2/0
C    30.0.0.0/8 is directly connected, Serial1/0


Here,R3 doesn't know about the area 3 so we have to create virtual link between R1 and R2






Step 6:Create virtual link between R1,R2,by this we create a virtual link to connect area 3 to area 0.


In Router R1,



R1(config)#router ospf 1
R1(config-router)#area 1 virtual-link 2.2.2.2
R1(config-router)#
*Feb 10 10:29:23.767: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on OSPF_VL0 from LOADING to FULL, Loadi
ng Done






In Rotuer R2,



*Feb 10 10:28:59.543: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 20.0.0.1, Serial1/0a
*Feb 10 10:29:09.535: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 20.0.0.1, Serial1/0.1.1


R2(config-router)#
R2(config-router)#area 1 virtual-link 1.1.1.1
R2(config-router)#exit
R2(config)#


*Feb 10 10:29:19.667: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on OSPF_VL0 from LOADING to FULL, Loadi
ng Done







Step 7:R2 and R3 get updates about Area 3 .Now,Check routing table of R3,




R3#show ip route
Codes: C - connected, S - static, 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
       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 IA 20.0.0.0/8 [110/128] via 30.0.0.1, 00:01:56, Serial1/0
C    40.0.0.0/8 is directly connected, FastEthernet2/0
O IA 10.0.0.0/8 [110/129] via 30.0.0.1, 00:01:56, Serial1/0
C     30.0.0.0/8 is directly connected, Serial1/0








Step 8:Check connectivity between host 10.0.0.10 to 40.0.0.10

How to configure Ospf Routing Protocol and Connect Areas




Trouble shooting


R3#show ip protocols
R3#show ip route ospf
R3#show ip ospf neighbors detail
R3#show ip ospf database
R3#show ip ospf interface


Post a Comment

  1. there is some mistype in R3 config
    #R3(config-router)#network 30.0.0.0 0.255.255.255 area 1
    #R3(config-router)#network 40.0.0.0 0.255.255.255 area 0
    Realy area 0,1 not area 0,2?

    ReplyDelete
  2. R2(config-router)#area 1 virtual-link 2.2.2.2
    wrong to? maybe R2#area 1 virtual-link 1.1.1.1

    ReplyDelete

 
Top