OSPF over Unnumbered Link
The only time that OSPF forms adjacency between neighbors that are no reside on the same subnet is when the neighbors are connected through an unnumbered point-to-point link. When enabling OSPF on an unnumbered interface, use the address-wildcard-mask pair of the primary physical interface which the unnumbered interface relies upon.
Note: OSPF does not work if one side unnumbered while the other side numbered on a link, as this would create discrepancy in the OSPF database and prevents routes from being installed into the routing table.
Below shows the OSPF neighbors, IP routing table, and OSPF database on RT1:
RT1#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 18.104.22.168 0 FULL/ - 00:00:33 172.16.2.1 Serial0/0 RT1# RT1#sh ip route Gateway of last resort is not set 22.214.171.124/32 is subnetted, 1 subnets C 126.96.36.199 is directly connected, Loopback0 188.8.131.52/32 is subnetted, 1 subnets O 184.108.40.206 [110/65] via 172.16.2.1, 00:00:34, Serial0/0 172.16.0.0/24 is subnetted, 2 subnets C 172.16.1.0 is directly connected, FastEthernet1/0 O 172.16.2.0 [110/65] via 172.16.2.1, 00:00:34, Serial0/0 RT1# RT1#sh ip ospf database OSPF Router with ID (220.127.116.11) (Process ID 100) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 18.104.22.168 22.214.171.124 58 0x80000002 0x00C835 3 126.96.36.199 188.8.131.52 61 0x80000001 0x00B73E 3 RT1#