# OSPF Adjacency Troubleshooting — Write-up

Writeups for https://www.pingmynetwork.com

## Topology

Three Cisco ISR4331 routers in a triangle, all in OSPF area 0:

```text
        R1 (1.1.1.1)
       /            \
  12.0.0.0/24    13.0.0.0/24
     /                \
R2 (2.2.2.2) --- R3 (3.3.3.3)
        23.0.0.0/24
```

| Link | Subnet | Endpoints |
|------|--------|-----------|
| R1-R2 | 12.0.0.0/24 | .1 / .2 |
| R1-R3 | 13.0.0.0/24 | .1 / .3 |
| R2-R3 | 23.0.0.0/24 | .2 / .3 |

Loopbacks: R1 = 1.1.1.1/32, R2 = 2.2.2.2/32, R3 = 3.3.3.3/32.

---

## Symptoms

In the initial state, OSPF adjacencies were not forming consistently:

- **R1** had `ip ospf hello-interval 20` on G0/0 but the default (10s) on G0/1.
- **R2** and **R3** used the default hello interval of 10s everywhere.
- **R3** had `passive-interface GigabitEthernet0/1` configured, which prevented it from forming any adjacency on the 23.0.0.0/24 link.
- All three routers were using the **wildcard `network 0.0.0.0 255.255.255.255 area 0`**, which is sloppy and can cause unintended interfaces to participate in OSPF.

The combination of a mismatched hello interval on R1's link to R2 and a passive interface on R3's link to R2 meant the full mesh never converged.

---

## Troubleshooting Steps

### 1. R1 - fix the hello-interval mismatch

R1's G0/0 was set to a 20-second hello interval while R2 was still using the default 10 seconds. OSPF requires hello/dead intervals to match on both ends of a link, so the R1-R2 adjacency stayed down.

```cisco
R1(config)# interface g0/0
R1(config-if)# ip ospf hello-interval 20
%OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
```

Once R2 also had the matching value (it was already configured with `ip ospf hello-interval 20` on G0/0 in the saved config), the adjacency came up.

### 2. R1 - replace the catch-all network statement

R1 was advertising with `network 0.0.0.0 255.255.255.255 area 0`. This was replaced with explicit network statements:

```cisco
R1(config)# router ospf 1
R1(config-router)# no network 0.0.0.0 255.255.255.255 area 0
R1(config-router)# network 1.1.1.1 255.255.255.255 area 0
R1(config-router)# network 12.0.0.0 0.0.0.255 area 0
R1(config-router)# network 13.0.0.0 0.0.0.255 area 0
R1(config-router)# ^Z
R1# wr mem
```

Note: removing the wildcard network statement briefly tore down both adjacencies (the `%OSPF-5-ADJCHG ... from FULL to DOWN` messages), and they re-formed once the specific networks were re-added.

### 3. R2 - same cleanup, plus an explicit router-id

R2 also had `network 0.0.0.0 255.255.255.255 area 0`. A couple of typos (`no network 0.0.0.0 ara 0`, `router-id 2.2.22.`) were rejected, then the correct commands were applied:

```cisco
R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 12.0.0.0 0.0.0.255 area 0
R2(config-router)# no network 0.0.0.0 255.255.255.255 area 0
R2(config-router)# network 23.0.0.0 0.0.0.255 area 0
R2(config-router)# network 2.2.2.2 255.255.255.255 area 0
R2# wr mem
```

After this, R2 saw both neighbors FULL:

```text
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/BDR        00:00:33    23.0.0.3        GigabitEthernet0/1
1.1.1.1           1   FULL/BDR        00:01:13    12.0.0.1        GigabitEthernet0/0
```

### 4. R3 - remove the passive interface and clean up networks

R3 was the main blocker on the 23.0.0.0/24 link because `passive-interface GigabitEthernet0/1` suppressed hellos on that interface.

```cisco
R3(config)# router ospf 1
R3(config-router)# no passive-interface gigabitEthernet0/1
%OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on GigabitEthernet0/1 from LOADING to FULL, Loading Done
R3(config-router)# no network 0.0.0.0 255.255.255.255 area 0
R3(config-router)# network 3.3.3.3 255.255.255.255 area 0
R3(config-router)# network 23.0.0.0 0.0.0.255 area 0
R3(config-router)# network 13.0.0.0 0.0.0.255 area 0
R3(config-router)# ^Z
R3# wr mem
```

Removing the wildcard network statement again caused a brief FULL-to-DOWN-to-FULL cycle, but all adjacencies recovered.

---

## Verification

After the fixes, every router showed a fully meshed OSPF adjacency table.

**R1:**

```text
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/BDR        00:00:30    13.0.0.3        GigabitEthernet0/1
2.2.2.2           1   FULL/DR         00:01:10    12.0.0.2        GigabitEthernet0/0
```

**R2:**

```text
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/BDR        00:00:33    23.0.0.3        GigabitEthernet0/1
1.1.1.1           1   FULL/BDR        00:01:13    12.0.0.1        GigabitEthernet0/0
```

**R3:**

```text
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/DR         00:00:38    23.0.0.2        GigabitEthernet0/1
1.1.1.1           1   FULL/DR         00:00:38    13.0.0.1        GigabitEthernet0/0
```

R3's `show ip ospf` confirmed a single area (area 0) with `Number of areas in this router is 1. 1 normal 0 stub 0 nssa`.

---

## Root Causes Summary

| Issue | Device | Fix |
|-------|--------|-----|
| Hello-interval mismatch (20s vs 10s) | R1 G0/0 to R2 G0/0 | Set matching `ip ospf hello-interval 20` on both sides |
| Passive interface suppressing hellos | R3 G0/1 | `no passive-interface GigabitEthernet0/1` |
| Overly broad `network 0.0.0.0 255.255.255.255 area 0` | All three | Replaced with explicit network statements per interface |
| No explicit router-id | R2 | `router-id 2.2.2.2` (also derived from loopback) |

---

## Key Takeaways

1. **Hello and dead intervals must match** on both ends of an OSPF link. A mismatch keeps the neighbor stuck in `INIT`/`DOWN`.
2. **`passive-interface` is a silent killer** - the interface still has an IP and is advertised, but no hellos are sent or received, so no adjacency forms.
3. **Avoid `network 0.0.0.0 255.255.255.255`** in production. It works, but it enables OSPF on every interface (including ones you may not intend) and makes troubleshooting harder. Use precise network statements or `ip ospf 1 area 0` under the interface.
4. Always finish with `write memory` (or `copy run start`) so the working config survives a reload.
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9