Basic OSPF Configuration | Cisco Router

In this lab we will configure the Open Shortest Path First routing protocol (OSPF) between two routers in the same area.  With OSPF you must use a wildcard mask in your network statements as shown below.

ospf
ospf

CIDR Information

Address:   172.16.0.1           10101100.00010000.00000000.000000 01
Netmask:   255.255.255.252 = 30 11111111.11111111.11111111.111111 00
Wildcard:  0.0.0.3              00000000.00000000.00000000.000000 11
!
Network:   172.16.0.0/30        10101100.00010000.00000000.000000 00
HostMin:   172.16.0.1           10101100.00010000.00000000.000000 01
HostMax:   172.16.0.2           10101100.00010000.00000000.000000 10
Broadcast: 172.16.0.3           10101100.00010000.00000000.000000 11
Hosts/Net: 2                     Class B, Private Internet

OSPF Configuration

R1(config)#router ospf 1
!
R1(config-router)#network 172.16.0.0 ?
  A.B.C.D  OSPF wild card bits
!
R1(config-router)#network 172.16.0.0 0.0.0.3 area ?
  <0-4294967295>  OSPF area ID as a decimal value
  A.B.C.D         OSPF area ID in IP address format
!
R1(config-router)#network 172.16.0.0 0.0.0.3 area 0
!
R2(config)#router ospf 1
R2(config-router)#network 172.16.0.0 0.0.0.3 area 0

Verification

R1#
*Oct 16 05:24:08.650: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.2 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
!
R2#
*Oct 16 05:24:08.922: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
!
R1#show ip ospf neighbor 
Neighbor ID     Pri   State           Dead Time   Address         Interface
172.16.0.2        1   FULL/DR         00:00:35    172.16.0.2      GigabitEthernet0/0
!
R2#show ip ospf neighbor 
Neighbor ID     Pri   State           Dead Time   Address         Interface
172.16.0.1        1   FULL/BDR        00:00:34    172.16.0.1      GigabitEthernet0/0

From the output above we can see that R2 is the Designated Router (DR) and R1 is the Backup Designated Router (BDR).  The election of R2 as the DR was made because it has the highest Neighbor ID. 

OSPF Hello Packet in Wireshark captured from R1

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here