Open In App

Configuring OSPF Router-ID in Cisco

Last Updated : 23 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

OSPF is a Link State Routing Protocol. In this method of Routing the Router shares its neighbor knowledge with everyone in the router. In OSPF one router is elected as Designated Router and one router is elected as Backup Designated Router(BDR). They are elected so that we can control how much repetitive information is forwarded over the network. Every Router in the network reports to the DR and the DR forwards the information to other routers in the network.

OSPF uses multicast addresses 225.0.0.6 and 225.0.0.5.

Router ID in OSPF:

  1. It is a 32-bit identity of a router used to identify a router in a network.
  2. Used in DR/BDR election.
  3. It is unique in an autonomous system.

Router-ID Election:

  1. Manually configured in OSPF.
  2. The highest IP is provided to a loopback interface.
  3. Highest IP provided to an active interface

Configuration:

Consider the topology:

Configuring The OSPF Router-ID in Cisco

 

Configuring R0:

interface GigabitEthernet0/0/0
ip address 10.0.0.1 255.255.255.252
no shutdown
interface GigabitEthernet0/0/1
ip address 172.16.1.1 255.255.255.252
no shutdown
router ospf 100
network 10.0.0.0 0.0.0.3 area 0
network 172.16.1.0 0.0.0.7 area 0
exit

Checking the OSPF process on R0:

 

Configuring R2:

interface GigabitEthernet0/0/0
ip address 20.0.0.1 255.255.255.252
no shutdown
interface GigabitEthernet0/0/1
ip address 172.16.1.2 255.255.255.252
no shutdown
interface Loopback0
ip address 1.1.1.1 255.255.255.255
router ospf 100
network 20.0.0.0 0.0.0.3 area 0
network 172.16.1.0 0.0.0.7 area 0
network 1.1.1.1 0.0.0.0 area 0
exit

Checking the OSPF process on R2:

 

Configuring R1:

interface GigabitEthernet0/0/0
ip address 30.0.0.1 255.255.255.252
no shutdown
interface GigabitEthernet0/0/1
ip address 172.16.1.3 255.255.255.248
no shutdown
router ospf 100
network 172.16.1.0 0.0.0.7 area 0
network 30.0.0.0 0.0.0.3 area 0
router-id 20.20.20.20
exit

interface loopback 0
ip add 2.2.2.2 255.255.255.255
ip ospf 100 area 0
exit
do clear ip ospf process

Checking the OSPF process on R1:

 

Configuring PC0:

 

Configuring PC1:

 

Configuring PC2:

 

As we can see:

  1.  R0’s router is the highest IP Address on the physical interface.
  2. R2’s router ID is the highest IP Address on the loopback interface. 
  3. R1’s router ID is the manually configured one

Simulation:


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads