OSPF Passive Interface Explained: Advertise Subnets Without Neighbors
Short answer: An OSPF passive interface advertises its connected subnet without forming neighbors on that interface; it does not remove that subnet from OSPF.[1] Use passive-interface default and explicitly allow only the links that should form adjacencies.[4]
This guide builds an original two-router lab with a user LAN that must remain reachable but must never become a routing peering segment. Examples are proposed configurations, not output captured from a running router.
Passive does not mean hidden, shut down or filtered
Cisco documents passive OSPF interfaces as stub networks, with no OSPF routing exchange on the interface.[1] The connected interface must still participate in the OSPF process; passive mode alone is not a command to enable or redistribute a prefix.[2]
A stub link is a description inside a router-LSA, not a Type-3 summary-LSA.[3] The number 3 used for a stub link type and the number 3 used for a summary LSA type belong to different fields.[3]
The practical distinction is simple: preventing neighbors is not preventing reachability.[1] If the requirement is “never advertise the finance LAN,” do not select passive mode as the withdrawal mechanism; review interface participation and routing policy instead.[1]
A lab requirement you can test
Build this small topology on isolated lab devices. All addresses below are invented private addresses; replace interface names to match your images.
User host Transit Test host
10.14.20.10/24 -- EDGE Gi2 EDGE Gi1 ----- CORE Gi1 CORE Gi2 -- 10.14.30.10/24
Gateway 10.14.20.1 .1 10.14.0.0/30 .2 Gateway 10.14.30.1
EDGE router ID: 10.255.14.1 CORE router ID: 10.255.14.2
All participating interfaces: area 0
Expected neighbor count: one on each router, none on either user LAN
Acceptance criteria for this proposed lab:
- Both routers form exactly one Full adjacency over the transit link.
- CORE learns
10.14.20.0/24as an intra-area OSPF route, the expected result of the advertised stub link.[2][3] - EDGE similarly learns
10.14.30.0/24through the active adjacency.[3] - A capture on either user LAN sees no OSPF Hellos sent by its passive gateway.[1]
- With correct host gateways and no blocking security rules, the two test hosts communicate.
Do not use this lab's lack of authentication as a production recommendation. The lab isolates passive-interface behavior; add authentication and control-plane protection in a separate validated change.
Cisco IOS XE configuration: allow neighbors only on transit
Cisco's documented pattern is a passive default with explicit no passive-interface exceptions.[4] Here, the three exact-address network statements select the transit, LAN and loopback interfaces; the exception allows only Gi1 to exchange OSPF.[1][4]
EDGE
interface GigabitEthernet1
description LAB_TO_CORE
ip address 10.14.0.1 255.255.255.252
no shutdown
!
interface GigabitEthernet2
description LAB_USER_LAN
ip address 10.14.20.1 255.255.255.0
no shutdown
!
interface Loopback0
ip address 10.255.14.1 255.255.255.255
!
router ospf 10
router-id 10.255.14.1
passive-interface default
no passive-interface GigabitEthernet1
network 10.14.0.1 0.0.0.0 area 0
network 10.14.20.1 0.0.0.0 area 0
network 10.255.14.1 0.0.0.0 area 0
CORE
interface GigabitEthernet1
description LAB_TO_EDGE
ip address 10.14.0.2 255.255.255.252
no shutdown
!
interface GigabitEthernet2
description LAB_TEST_LAN
ip address 10.14.30.1 255.255.255.0
no shutdown
!
interface Loopback0
ip address 10.255.14.2 255.255.255.255
!
router ospf 10
router-id 10.255.14.2
passive-interface default
no passive-interface GigabitEthernet1
network 10.14.0.2 0.0.0.0 area 0
network 10.14.30.1 0.0.0.0 area 0
network 10.255.14.2 0.0.0.0 area 0
The loopbacks deliberately use /32 addresses: Cisco normally advertises OSPF loopbacks as host routes.[4] Passive mode is not a way to change their advertised mask.[3][4]
Safe rollout matters more than command brevity
On existing routers, enabling a passive default without the necessary exceptions can remove wanted adjacencies.[4] Cisco also documents release- and platform-dependent behavior when reapplying the default command: do not assume repeated automation is harmless on every IOS XE image.[1]
For a production adaptation, prepare an approved transit-interface allowlist first. Arrange independent management access, take a configuration backup, and define a timed rollback before changing the active routing process. Verify the saved configuration and current neighbors after applying the change; do not rely on an automation task returning “changed: false.”
FRRouting: equivalent intent, different interface syntax
FRRouting 10.1 documents ip ospf passive under an interface; it advertises the interface as a stub link without speaking OSPF there.[2] Its router-level passive default can be overridden by interface configuration.[2]
This alternative EDGE fragment assumes the Linux interfaces already have the addresses shown in the topology. The selected style uses interface-based area activation throughout.
router ospf
ospf router-id 10.255.14.1
passive-interface default
!
interface eth0
description LAB_TO_CORE
ip ospf area 0.0.0.0
no ip ospf passive
!
interface eth1
description LAB_USER_LAN
ip ospf area 0.0.0.0
ip ospf passive
!
interface lo
ip ospf area 0.0.0.0 10.255.14.1
ip ospf passive
Do not mix FRR network-based activation with interface ip ospf area activation on this router; the referenced release documents that combination as unsupported.[2] Check your installed version rather than copying Cisco syntax into vtysh.[2]
What happens to packets and routes?
In the proposed lab, follow one destination: 10.14.20.10.
- EDGE has an operational connected LAN interface selected into area 0.
- EDGE describes the passive LAN as a stub link in its router-LSA.[1][2]
- The description reaches CORE over the active transit adjacency; the LAN itself needs no neighbor.[1][3]
- CORE should install
10.14.20.0/24through10.14.0.1, assuming no preferred competing route: this is the expected SPF outcome, not a captured result.[3] - A packet for the test user should reach EDGE through transit, then follow EDGE's connected LAN route; compare forwarding with the calculated next hop.[3]
A passive interface is therefore not a data-plane deny rule: the feature stops OSPF exchange while preserving the subnet's routing description.[1] Treat “no neighbor on the user LAN” and “no user traffic on the LAN” as completely different acceptance criteria.
Outbound control, inbound influence and limits
OSPF calculates routes from topology and costs; its destination-based SPF calculation is not a per-application firewall policy.[3] Passive mode changes adjacency participation, not the cost policy you would use to prefer one of two live exits.[1][3]
| Requirement | Decision for this design |
|---|---|
| Stop users from becoming OSPF neighbors on Gi2 | Keep Gi2 passive; verify no Hellos and no neighbors |
| Keep the user LAN reachable from CORE | Leave Gi2 selected into OSPF; confirm the remote route |
| Prefer one outbound WAN exit | Design OSPF costs or default/external route policy separately |
| Influence traffic arriving from the OSPF domain | Review the advertised destination and the domain's path costs |
| Control Internet inbound path selection | Use the appropriate edge/BGP policy; this LAN setting is not that policy |
| Prevent access to sensitive hosts | Apply separately reviewed firewall/ACL rules |
| Withdraw a dead upstream default | Validate the default-origination health logic, not passive mode |
For a dual-exit adaptation, document paths in both directions before deployment. A passive user LAN does not guarantee symmetric stateful-firewall traversal; test the actual flows instead of using neighbor state as a proxy for application success.
Verification commands and expected logic
On IOS XE:
show ip ospf neighbor
show ip ospf interface GigabitEthernet1
show ip ospf interface GigabitEthernet2
show ip protocols
show ip ospf database router 10.255.14.1
show ip route 10.14.20.0
show ip route 10.14.30.0
show running-config | section router ospf
On FRR:
show ip ospf neighbor
show ip ospf interface eth0
show ip ospf interface eth1
show ip ospf database router
show ip route 10.14.20.0/24
These are proposed checks, not fabricated device output. Evaluate the following evidence separately:
| Check location | Expected lab evidence | If it fails |
|---|---|---|
| EDGE and CORE neighbor tables | One Full transit neighbor each | Check passive exception, area, timers, authentication, MTU and reachability |
| EDGE Gi2 OSPF detail | Passive/no-Hello indication, wording varies | Check the effective interface and process configuration |
| CORE router-LSA for EDGE | Stub entry for 10.14.20.0 with /24 mask | Check LAN line state and OSPF selection |
| CORE route lookup | Intra-area route via 10.14.0.1 | Check LSDB, competing routes and next-hop reachability |
| EDGE local LAN lookup | Connected route | Do not expect its own connected LAN to appear as a learned OSPF route |
| LAN capture | No OSPF packets sent by EDGE Gi2 | Check the actual gateway, interface and capture direction |
| End-to-end test | Forward and return traffic succeed | Inspect host gateways, ACLs and return routes |
OSPFv2 uses IP protocol 89, not TCP or UDP port 89; use a protocol filter when capturing.[3] On the lab LAN, for example:
sudo tcpdump -ni eth1 'ip proto 89'
A quiet capture alone does not prove reachability or correct advertisement. Correlate it with the remote router-LSA, routing table and a host-to-host test.
Troubleshooting checklist: a passive LAN is still advertised
- No neighbor on transit: verify Gi1 is explicitly non-passive in the intended OSPF process; confirm that the peer also activates OSPF.[4]
- No neighbor on the user LAN: this is an intended result here, not automatically a fault.[1]
- LAN route missing remotely: check interface state, address, mask, area membership, and the originator's router-LSA before changing costs; passive advertisement still requires OSPF interface activation.[2][3]
- LAN visible despite being passive: this is documented behavior, not a route leak caused by a broken passive command.[1]
- Loopback appears as /32: that is normal OSPF loopback behavior; inspect network type if a different mask is required.[4]
- New subnet unexpectedly advertised: audit broad OSPF interface-selection rules; a passive default is an adjacency allowlist, not a prefix export allowlist.[1][2]
- Routes remain but traffic fails: inspect return routing, host configuration and security policy separately.
- Automation caused a flap: compare the exact image and platform with the vendor caveat; preserve evidence before rerunning commands.[1]
Modern use: routed campuses and fabric loopbacks
For an OSPF-based underlay proposal, keep true router-to-router links active and review loopback reachability independently. Advertising a loopback does not require a neighboring router on that loopback; host routes are part of OSPF's router-LSA model.[3][4]
Do not transplant this OSPF configuration into an eBGP underlay or EVPN overlay. This article's scope is OSPF interface participation, not EVPN route-target policy or Cisco ACI fabric configuration. For a cloud-edge adaptation, first verify whether your actual attachment supports OSPF at all.
Interview answer
Suggested answer (original wording): A passive OSPF interface does not form neighbors, but its selected connected subnet remains advertised as a stub link.[1] Use a passive default and allowlist the transit links.[4] Verify the neighbor table, router-LSA and remote route separately.
Summary
Keep the distinction clear: adjacency permission is not prefix withdrawal.[1] In your lab, prove both halves of the requirement: no user-LAN neighbor, and a working remote route to that LAN. Run the failure checks before adapting the example to production.
Related reading
- OSPF cost and reference bandwidth
- OSPF route filtering: distribute lists versus ABR filter lists
- OSPF authentication and safe migration
- OSPF default origination and IP SLA
Sources
- Cisco IOS XE: Default Passive Interfaces
- FRRouting 10.1: OSPFv2
- RFC 2328: OSPF Version 2
- Cisco: OSPF Frequently Asked Questions
Try it: OSPF Cost Calculator - free, runs in your browser. Also try: Wildcard Mask Calculator - free, runs in your browser.
Related reading
- OSPF ECMP Explained: Equal-Cost Routes, Load Sharing and Troubleshooting
- OSPF Default Route Origination: Always, E1/E2 and IP SLA
- OSPF Route Filtering Explained: Distribute Lists vs ABR Filter Lists
- OSPF Authentication Explained: HMAC-SHA-256, Key Chains and Safe Migration
- OSPF Summarization Explained: ABR area range, ASBR Summaries and Blackholes
- OSPF Cost and Reference Bandwidth: Fix Path Selection and Asymmetric Routing
Comments
Post a Comment