Router-Id Command on CISCO Router/Switch




This command manually sets the router-id used by OSPF. If it is not set, OSPF will automatically set its router-id to be the highest loopback IP address or the highest IP address (if no loopback interfaces are present). One thing to note is, even though the router-id is based on an IP address, it can be set to any 32 bit number in an IP address format. For example: is an acceptable router-id.


Router(config-router)#router-id <ip address>


In this example we will change R1’s router-id to

R1(config)#router ospf 1
Reload or use “clear ip ospf process” command, for this to take effect
R1(config-router)#do clear ip ospf pro
Reset ALL OSPF processes? [no]: y

We can now see that, on R2, the change has taken effect.

R2(config-router)#do show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface 1 FULL/DR 00:00:32 FastEthernet1/0 1 FULL/DR 00:00:38 FastEthernet0/0

Related Articles

Leave a Reply