This guide walks through a production-grade OSPFv2 setup on an MX104 / MX204 class router, from interface preparation to verification.

1. Interface Preparation

Before OSPF can run, every P2P interface must have a logical unit with an IP address and the OSPF-friendly MTU. On MX:

set interfaces ge-0/0/1 description "CORE-LINK-to-MX2"
set interfaces ge-0/0/1 unit 0 family inet address 10.0.12.1/30
set interfaces ge-0/0/1 unit 0 family inet mtu 1500
MTU 1500 on every OSPF interface — non-negotiable. A single 1472-byte jumbo MTU on a neighbor will put the OSPF adjacency permanently in ExStart.

2. OSPF Configuration

The full OSPF stanza for a single-area deployment with MD5 authentication on every interface:

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 authentication md5 1 key "$9$ABCD-EFG"
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf reference-bandwidth 100g

3. Reference Bandwidth — Almost Always Forgotten

The default reference-bandwidth on Junos is 100 Mbps. With that setting, a 100G link costs the same as a 100M link in OSPF metric terms. Set it to 100G:

set protocols ospf reference-bandwidth 100g

Set this uniformly across the area — mixed values produce inconsistent metrics.

4. Verification

show ospf neighbor
show ospf interface
show ospf database summary
show route protocol ospf

A healthy show ospf neighbor on a P2P link looks like:

Interface  State   Area         Neighbor ID  Pri   Dead
ge-0/0/1   Full   0.0.0.0      10.0.0.2     128   38

If you see any other state — Init, ExStart, Exchange, Loading — you have a real bug; fix it before trusting the network.

5. Common Pitfalls

5.1 lo0 not passive

Symptom: the loopback becomes transit. Add set protocols ospf area 0 interface lo0.0 passive.

5.2 MTU mismatch

Symptom: neighbor stuck in ExStart. Both sides must have identical MTU.

5.3 Missing MD5 key ID

Symptom: neighbor never reaches Full. Both sides must use the same key ID number, not just the same key text.

6. Where To Go From Here

For multi-area summarization, see MX CoS deep dive for QoS on these links. For BGP at this scale, see BGP flap field method. For EVPN-VXLAN on EX leaves, see EX as VXLAN leaf.