Dec 302012
 

Each OSPF routers have a unique identification number which represents the router to the OSPF domain. If the ID is configured using the router-id command, it will be preferred over any highest loopback IPv4 address.

When looking out at the detailed output of a route in the routing table, the advertising routers RID will be displayed. Thus looking at the RIB we can determine to which router the network is attached.

R1#sh ip route 3.3.3.3
Routing entry for 3.3.3.0/24
  Known via "ospf 1", distance 110, metric 30, type inter area
  Last update from 10.0.123.2 on FastEthernet0/0, 00:38:31 ago
  Routing Descriptor Blocks:
  * 10.0.123.2, from 22.22.22.22, 00:38:31 ago, via FastEthernet0/0
      Route metric is 30, traffic share count is 1

If we want IP reachability to advertising router IP, then the RID must be an IPv4 address of an interface which is OSPF activated. In the above example the router with ID of 22.22.22.22 is advertising the network 3.3.3.3.

The method of assigning the RID manually with router-id command is the most stable method, but then this IP will not be reachable because it does not exist at all. The preferable method is to create a loopback interface which has the same IP address as the RID. This interface must also be advertised via OSPF preferably.

R1#sh ip route 22.22.22.22
% Network not in table
 
R2(config)#interface loopback 22
R2(config-if)#ip address 22.22.22.22 255.255.255.255
R2(config-if)#ip ospf 1 area 0
 
R1#sh ip route 22.22.22.22
Routing entry for 22.22.22.22/32
  Known via "ospf 1", distance 110, metric 11, type intra area
  Last update from 10.0.123.2 on FastEthernet0/0, 00:00:01 ago
  Routing Descriptor Blocks:
  * 10.0.123.2, from 22.22.22.22, 00:00:01 ago, via FastEthernet0/0
      Route metric is 11, traffic share count is 1

 

After R2 has an IPv4 interface which is the same as router-id, all other routers in the OSPF domain can ping the advertising router.