Juniper JunOS Multi-area OSPF
Multi-area OSPFv2 configuration for Juniper routers: areas, stub/NSSA, route summarization, authentication, and redistribution via JunOS set commands.
What is it?
Juniper OSPF configuration differs from Cisco in two key ways: (1) Interfaces are enabled per-area under the protocol stanza — not with 'network' statements. (2) Route redistribution uses explicit export policies ('policy-options policy-statement') rather than 'redistribute' commands. JunOS supports both OSPFv2 (IPv4) and OSPFv3 (IPv6) as separate protocol instances. Traffic engineering extensions (OSPF-TE) are commonly enabled on Juniper for MPLS/RSVP path computation. The loopback interface (lo0.0) should always be in OSPF as passive.
When to use
- ·Multi-router Juniper deployments needing dynamic routing
- ·Mixed-vendor environments — OSPF is an open standard that works with Cisco, Arista, etc.
- ·MPLS provider networks where OSPF carries TE extensions for label-switched paths
- ·Data center underlay routing for VXLAN EVPN fabrics
When NOT to use
- ·ISP peering or inter-AS routing — use BGP for external routing
- ·Very small networks with 2-3 routers — static routes are simpler
How it compares
Prerequisites
- →Interfaces must have IP addresses configured before enabling OSPF on them
- →Router ID should be a loopback address — configure loopback before OSPF
- →Area 0 (backbone) must exist for multi-area designs
- →Export policies must be created before referencing them in 'protocols ospf export'
Config Generator
Verification commands
show ospf neighborVerify OSPF adjacency state with all neighbors
ExpectedNeighbors should show 'Full' state. '2Way' on broadcast links means DR/BDR election issue.
show ospf routeShow OSPF routes in the OSPF routing table
ExpectedLists all OSPF-learned routes with area, metric, and next-hop
show route protocol ospfShow OSPF routes installed in the main routing table
ExpectedRoutes marked with 'OSPF' source. Missing routes indicate export policy or redistribution issue.
Debug commands
show ospf interface detailShow OSPF interface state, hello/dead timers, and DR/BDR election
Common mistakes & fixes
Further learning
Recommended books to go deeper on this topic.
OSPF: Anatomy of an Internet Routing Protocol
John T. Moy · Addison-Wesley · The protocol from its author: LSA types, flooding, SPF and the design reasoning behind them
Routing TCP/IP, Volume 1
Jeff Doyle & Jennifer Carroll · Cisco Press · The definitive OSPF and IS-IS reference — essential for CCNP/CCIE
CCNP Enterprise Core ENCOR 350-401 Official Cert Guide
Brad Edgeworth et al. · Cisco Press · OSPF single-area, multi-area, LSA types, route summarization