PacketLab
OSPF · Fundamentals and adjacency

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.

Lab topologyIllustrative topology
192.0.2.0/30area 0R1Lo0 · 10.255.0.1/32R2Lo0 · 10.255.0.2/32
Solid lines are physical links, configured as point-to-point. Interfaces and areas are listed below. Router symbol: GNS3, GPL-2.0. Original layout.
RouterInterfaceIPv4 addressArea
R1Gi1192.0.2.1/300
R2Gi1192.0.2.2/300

Loopback0 is 10.255.0.<router number>/32; area assignments: R1: area 0, R2: area 0.

Complete baseline configurations

R1

Configuration
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
end

R2

Configuration
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
end

Apply

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

Configuration
configure terminal
interface GigabitEthernet1
 ip ospf 1 area 0
end

R1 sends Hellos, but no neighbor appears until the other endpoint participates.

R2

Configuration
configure terminal
interface GigabitEthernet1
 ip ospf 1 area 0
end

Verify and interpret

Illustrative output · excerpt
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  GigabitEthernet1

The neighbor ID is R2’s identity; Address is R2’s link address. They need not be equal.

Illustrative output · excerpt
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

OSPFv2 standard · Router configuration guide

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.

First adjacency Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. Which IP protocol carries OSPF?
2. What does ip ospf 1 area 0 select?
3. R1 is enabled but R2 is not. What is expected?
4. Which field identifies R2 rather than its transit interface?
5. What is the remote loopback cost here?
6. Why source the ping from Loopback0?