First adjacency
Enable a link deliberately, confirm the peer identity and prove a remote loopback is reachable.
Understand
Start with addressed, up interfaces. OSPF runs directly over IP protocol 89, not a TCP session. On this point-to-point link, Hellos discover the other router; database exchange then creates a Full adjacency.
The interface command selects the local process and area. A process-level network statement is an alternative interface selector, not an instruction to originate an arbitrary prefix absent from the router. Avoid broad selectors that accidentally activate user-facing interfaces.
Configure a unique router ID before the process becomes active. An explicit ID avoids dependence on interface selection. Changing an active ID may require a process restart, which disrupts adjacencies; schedule that operation rather than adding it to a routine check.
Lab setup
Use a fresh lab for this lesson; changes from other lessons are not cumulative. All outputs are illustrative excerpts, not recorded router tests. Transit cost is explicitly 10 and Loopback0 cost is 1. Interface names may vary by image.
| Router | Interface | IPv4 address | Area |
|---|---|---|---|
| R1 | Gi1 | 192.0.2.1/30 | 0 |
| R2 | Gi1 | 192.0.2.2/30 | 0 |
Loopback0 is 10.255.0.<router number>/32; area assignments: R1: area 0, R2: area 0.
Complete baseline configurations
R1
configure terminal
hostname R1
router ospf 1
router-id 10.255.0.1
passive-interface Loopback0
exit
interface Loopback0
ip address 10.255.0.1 255.255.255.255
ip ospf 1 area 0
ip ospf cost 1
exit
interface GigabitEthernet1
ip address 192.0.2.1 255.255.255.252
ip ospf network point-to-point
ip ospf cost 10
ip ospf 1 area 0
no shutdown
exit
endR2
configure terminal
hostname R2
router ospf 1
router-id 10.255.0.2
passive-interface Loopback0
exit
interface Loopback0
ip address 10.255.0.2 255.255.255.255
ip ospf 1 area 0
ip ospf cost 1
exit
interface GigabitEthernet1
ip address 192.0.2.2 255.255.255.252
ip ospf network point-to-point
ip ospf cost 10
ip ospf 1 area 0
no shutdown
exit
endApply
The complete baseline below Lab setup is the final configuration. To observe the activation sequence, begin with the same addresses but omit the two Gi1 OSPF activation commands. Then apply each stage below. Loopbacks remain enabled and passive as in the baseline.
R1
configure terminal
interface GigabitEthernet1
ip ospf 1 area 0
endR1 sends Hellos, but no neighbor appears until the other endpoint participates.
R2
configure terminal
interface GigabitEthernet1
ip ospf 1 area 0
endVerify and interpret
R1# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
10.255.0.2 0 FULL/- 00:00:37 192.0.2.2 GigabitEthernet1The neighbor ID is R2’s identity; Address is R2’s link address. They need not be equal.
R1# show ip route ospf
O 10.255.0.2/32 [110/11] via 192.0.2.2, GigabitEthernet1
R1# ping 10.255.0.2 source Loopback0
!!!!!
Success rate is 100 percent (5/5)Cost 11 is the outgoing transit cost 10 plus R2’s loopback cost 1. A sourced ping exercises the return route too.
If no neighbor appears, compare OSPF interface state and addressing on both ends before changing timers. Keep the successful baseline for the neighbor-state lesson.
Technical references
Key Takeaways
- Activate OSPF only on intended interfaces.
- Process IDs select local instances and need not match.
- Router IDs must be unique and are independent of link addresses.
- Full shows completed database synchronization on this point-to-point link.
- Check the remote route and sourced reachability after checking neighbors.