The LAN needs a route, but it does not need a neighbour
PC-A, 192.168.1.10/24, sends traffic through R1 towards PC-B, 192.168.2.10/24. PC-B connects through SW2 to R2's Gi0/2 interface, 192.168.2.1/24. That address is PC-B's default gateway: the router used for destinations outside its own subnet.
R1 needs a route to 192.168.2.0/24. R2 can advertise that network through OSPF (Open Shortest Path First), but PC-B does not run this routing protocol. There is no reason for R2 to send discovery packets onto this user LAN.
A passive interface solves those two requirements separately. It remains selected for OSPF, so its subnet can be advertised through R2's other adjacencies. It sends no OSPF Hellos, the packets used to discover and maintain neighbours, and does not use received Hellos to form an adjacency on that interface. Passive does not stop Ethernet frames from physically arriving at the port.
Compare three settings on the same LAN interface
Change only R2 Gi0/2 in these snapshots. Its link to R1 stays active.
Enabled and active
R2 includes LAN 2 in OSPF and sends Hellos on Gi0/2. The subnet is advertised, but no neighbour forms because PC-B is an end host. This works for route learning, yet it leaves unnecessary OSPF discovery active on the user network.
- Router link
- R1 (RID 1.1.1.1) Gi0/1 10.0.12.1/30 ↔ R2 (RID 2.2.2.2) Gi0/0 10.0.12.2/30. Area 0; P2P; Full; Hello/Dead 10/40 s; no authentication; MTU 1500.
- LAN devices and ports
- R2 Gi0/2 192.168.2.1/24 → SW2 Gi0/1; SW2 Gi0/2 → PC-B Ethernet 192.168.2.10/24, gateway 192.168.2.1. SW2: Layer 2. No OSPF peer on this VLAN.
- Prefix and cost key
- LAN prefix: 192.168.2.0/24. Masks: /24 = 255.255.255.0; /30 = 255.255.255.252. Local process 1; gigabit interfaces, reference 10000 Mbps, cost 10.
- Snapshot conditions
- Active Gi0/2 is in area 0. PC-B runs no OSPF. R1 learns LAN 2 via R2 at cost 20.
Enabled and passive
R2 still includes LAN 2 in its OSPF information. The difference is local activity on Gi0/2: no Hellos and no adjacency. R1 keeps its route to LAN 2 through R2. This is the intended configuration for this example.
- Router link
- R1 (RID 1.1.1.1) Gi0/1 10.0.12.1/30 ↔ R2 (RID 2.2.2.2) Gi0/0 10.0.12.2/30. Area 0; P2P; Full; Hello/Dead 10/40 s; no authentication; MTU 1500.
- LAN devices and ports
- R2 Gi0/2 192.168.2.1/24 → SW2 Gi0/1; SW2 Gi0/2 → PC-B Ethernet 192.168.2.10/24, gateway 192.168.2.1. SW2: Layer 2. No OSPF peer on this VLAN.
- Prefix and cost key
- LAN prefix: 192.168.2.0/24. Masks: /24 = 255.255.255.0; /30 = 255.255.255.252. Local process 1; gigabit interfaces, reference 10000 Mbps, cost 10.
- Snapshot conditions
- Passive Gi0/2 remains in area 0. R1 retains O 192.168.2.0/24 [110/20] via 10.0.12.2.
Excluded from OSPF
Removing all OSPF activation from Gi0/2 has a different result. R2 still has a connected LAN route because the interface is up, but it no longer advertises that LAN through interface participation. With no other advertisement in this lab, R1 loses the learned /24 after convergence. That is why deleting the network statement is not a substitute for passive.
- Router link
- R1 (RID 1.1.1.1) Gi0/1 10.0.12.1/30 ↔ R2 (RID 2.2.2.2) Gi0/0 10.0.12.2/30. Area 0; P2P; Full; Hello/Dead 10/40 s; no authentication; MTU 1500.
- LAN devices and ports
- R2 Gi0/2 192.168.2.1/24 → SW2 Gi0/1; SW2 Gi0/2 → PC-B Ethernet 192.168.2.10/24, gateway 192.168.2.1. SW2: Layer 2. No OSPF peer on this VLAN.
- Prefix and cost key
- LAN prefix: 192.168.2.0/24. Masks: /24 = 255.255.255.0; /30 = 255.255.255.252. Local process 1; gigabit interfaces, reference 10000 Mbps, cost 10.
- Snapshot conditions
- Gi0/2 has no OSPF activation. No other source advertises LAN 2. R2 keeps its connected LAN; R1 loses this OSPF /24 after convergence.
Use passive on an OSPF-enabled LAN where no neighbour is intended. An excluded prefix could still be advertised by redistribution or another source.
Passive prevents unintended adjacency on the LAN; authentication and access controls still matter.
Configure one LAN interface
Use these Cisco IOS/IOS XE style commands on the router and interface shown. Interface names can differ by image. router ospf 1 enters the local OSPF process configuration; passive-interface then names the interface whose neighbour activity should stop. It does not itself select that interface for OSPF.
Start from privileged EXEC, R2#, and enter configure terminal to reach R2(config)#. The first line below changes the prompt to R2(config-router)#. Process number 1 is local to R2 and need not match its peers. The final exit returns to global configuration; use end before running show commands.
router ospf 1
passive-interface GigabitEthernet0/2
exitR2 only, from global configuration mode. Gi0/2 is already enabled in area 0. The command belongs under router ospf, not under interface configuration.
If Gi0/2 is not already enabled, use ip ospf 1 area 0 under interface GigabitEthernet0/2, or a matching network statement under the OSPF process. See the configuration lesson.
Make passive the default, then allow router links
With several LANs it is easier to make passive the process default and explicitly allow only the router links. On R2, Gi0/0 reaches R1 at 10.0.12.1, and Gi0/1 reaches R3 at 10.0.23.2. These two links need active discovery. Gi0/2 reaches PC-B's LAN and should remain passive.
See the active exceptions on R2
- Router ports and IDs
- R1 RID 1.1.1.1, Gi0/1 10.0.12.1/30 ↔ R2 RID 2.2.2.2, Gi0/0 10.0.12.2/30. R2 Gi0/1 10.0.23.1/30 ↔ R3 RID 3.3.3.3, Gi0/0 10.0.23.2/30. Both links: area 0, P2P, Hello 10 / Dead 40 s, expected Full.
- LAN and configuration
- R2 Gi0/2 192.168.2.1/24 → SW2 Gi0/1; SW2 Gi0/2 → PC-B Ethernet 192.168.2.10/24, gateway 192.168.2.1. All R2 interfaces already have OSPF activation in local process 1. New interfaces also need activation before their networks can be advertised.
router ospf 1
passive-interface default
no passive-interface GigabitEthernet0/0
no passive-interface GigabitEthernet0/1
exitR2 only, from global configuration mode. Intended final policy for an initial lab build: Gi0/0 towards R1 and Gi0/1 towards R3 are active; Gi0/2 towards PC-B remains passive. Interfaces are already enabled for OSPF.
Changing passive policy can interrupt adjacencies. This is an initial-build configuration; plan a live migration separately.
New interfaces still need OSPF activation; new router links also need a non-passive exception.
Verify the passive setting and the active neighbours
Start with the detailed interface output. The area and process identify its OSPF participation. The line No Hellos (Passive interface) confirms the intended behaviour. A blank neighbour table on a PC-only LAN is expected; the important neighbours are on R2's two router-facing interfaces.
The following outputs are written examples, not router captures. The router links in this main lab use OSPF point-to-point network type, as in the configuration lesson; FULL/ - therefore has no DR or BDR role. Their interfaces and LANs already have the configured addresses and are up.
R2#show ip ospf interface GigabitEthernet0/2 Internet Address 192.168.2.1/24, Area 0 Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10 No Hellos (Passive interface) Neighbor Count is 0, Adjacent neighbor count is 0
R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 0 FULL/ - 00:00:37 10.0.12.1 GigabitEthernet0/0 3.3.3.3 0 FULL/ - 00:00:34 10.0.23.2 GigabitEthernet0/1
show ip protocolsPrivileged EXEC on R2: inspect the passive-interface policy and configured network selection. Use the detailed interface and live neighbour outputs to confirm the result.
Verify the remote route and the user's packet path
On R1, look for LAN 2's prefix rather than R2's router ID. The route's next hop, 10.0.12.2, is R2's address on the link R1 can reach directly. Traffic can then leave R2 Gi0/2 towards PC-B even though that interface is passive for OSPF.
Follow the user's packet across the passive LAN interface
192.168.2.10 is outside PC-A’s /24 subnet. PC-A addresses the Ethernet frame to R1’s LAN MAC address and sends through SW1.
Ports, settings and assumptions
SW1 Gi0/2 connects PC-A; Gi0/1 connects R1 Gi0/0. SW2 Gi0/1 connects R2 Gi0/2; Gi0/2 connects PC-B. R1/R2: area 0, point-to-point transit, interface cost 10, process 1, MTU 1500. R1 has O 192.168.2.0/24 [110/20] via 10.0.12.2. Routes, ARP, host gateways and permitting policy are assumed ready; no NAT. Grey lines are Ethernet; blue arrows show the selected hop; orange marks the packet. This is a forwarding illustration, not a device lab or complete ping exchange.
Assume no competing preferred route to LAN 2 in this lab. We are checking that OSPF supplies the route, rather than a static route hiding a missing advertisement.
R1#show ip route 192.168.2.0 Routing entry for 192.168.2.0/24 Known via "ospf 1", distance 110, metric 20 Routing Descriptor Blocks: * 10.0.12.2, via GigabitEthernet0/1
Test PC-A 192.168.1.10 to PC-B 192.168.2.10 and back. If a prefix is missing, check activation, advertisement and route selection.
Short lab: prove that passive keeps the route
Start with the working three-router configuration in an isolated lab. Record R1's route to LAN 2 and R2's active neighbours. Make only R2 Gi0/2 passive using the first configuration block, then repeat these checks.
show ip ospf interface GigabitEthernet0/2
show ip ospf neighborR2, privileged EXEC. Confirm No Hellos on the LAN while the R1 and R3 router adjacencies remain Full.
show ip route 192.168.2.0R1, privileged EXEC. The route should still use R2 at 10.0.12.2 with metric 20 under this lesson's reference-bandwidth assumptions.
Ping PC-B from PC-A and confirm the return traffic works. If the route remains but ping fails, check the hosts' masks, gateways and any filtering. Changing passive again will not repair an incorrect PC gateway. Keep Gi0/2 passive as the final intended state.
Recover a router link that was made passive by mistake
In this isolated chain, making R2 Gi0/1 passive removes the R3 adjacency and the paths that depend on it after the change is detected. Gi0/1 can still show up/up, because the cable has not failed. R2's Gi0/0 adjacency to R1 should remain Full. If you test this fault, record the working state first and use the lab console so you can restore the setting.
To restore that link under the passive-default policy, return to R2's global configuration mode and apply the exception below. Keep the default policy and Gi0/2's passive state; removing the entire policy would enable discovery on user LANs too.
router ospf 1
no passive-interface GigabitEthernet0/1
endRecovery on R2, starting at R2(config)#. This exception permits neighbour discovery on the R3 link; it does not repair an area, timer or addressing mismatch.
Run show ip ospf interface GigabitEthernet0/1 on R2 and check that it is no longer passive. Then confirm R3 returns to Full in show ip ospf neighbor, the expected LAN 3 route returns, and the affected host traffic works in both directions. If no neighbour returns, inspect R3's corresponding interface too. A passive setting at either end prevents the relationship.
Reference: Cisco IOS XE default passive interfaces.
Practise LAN and transit behaviour on R1
This companion lab switches to the OSPF overview's R1 topology. Use R1 Gi0/0 for LAN 1 and Gi0/1 towards R2; the earlier R2 Gi0/2 commands belong to the lesson above. This practice link uses broadcast OSPF, with R2 as DR.
Success means the LAN stays passive while the router link stays active. Open the guided exercise below to compare both settings yourself.
Simulated R1 terminal. Type supported IOS commands and inspect the result. R2 and R3 are preconfigured. Outputs are simplified teaching examples, not responses from real equipment. Changes last until reset or page reload.
R1 is ready. Try show ip ospf neighbor, or ? for help.
Ready. Type a command and press Enter.
Try a guided troubleshooting exercise
- Run
show ip ospf interface Gi0/0. LAN 1 is OSPF-enabled but passive: no Hellos, no neighbours, and its prefix remains advertised. - Enter
enable,configure terminal, thenrouter ospf 1. - Try
no passive-interface Gi0/0, thendo show ip ospf interface Gi0/0. Hellos are enabled, but no neighbour appears: this LAN contains end devices only. - Restore
passive-interface Gi0/0. Checkdo show ip ospf neighbor: R2 remains Full over the separate Gi0/1 transit link. - Make the wrong interface passive with
passive-interface Gi0/1. Comparedo show ip route ospfanddo ping 10.0.12.2: learned routes disappear, but the directly connected peer still answers. - Recover with
no passive-interface Gi0/1. Verify the neighbour and remote routes return. The desired policy is LAN passive, transit active.
Test yourself on passive interfaces
R2's OSPF-enabled Gi0/2 (LAN 2, 192.168.2.0/24) is made passive; its R1 adjacency remains Full. What happens to R1's route to 192.168.2.0/24?
R2 has passive-interface default and no non-passive exceptions. After the change has taken effect, how many OSPF neighbours does it have?
Where do you type passive-interface GigabitEthernet0/2?
Which interface in the lab should NOT be passive?