β οΈ Prima di leggere: hai provato tutti i show ip ospf neighbor e show ip ospf interface? Il ragionamento Γ¨ piΓΉ importante dei comandi.
BUG 1
R1: passive-interface applicata su Se0/0/0 β nessun Hello OSPF inviato
π Come identificarlo:
R1# show ip ospf interface Se0/0/0
Serial0/0/0 is up, line protocol is up
Internet Address 10.0.0.1/30, Area 0
No Hellos (Passive interface)
π§ Fix:
R1# conf t
R1(config)# router ospf 1
R1(config-router)# no passive-interface Serial0/0/0
PerchΓ© funziona: passive-interface blocca l'invio di Hello OSPF sull'interfaccia β nessun hello = nessuna adjacency. Si usa sulle interfacce LAN per non inviare hello verso host che non parlano OSPF. Mai sull'interfaccia verso un altro router OSPF.
BUG 2
R1: router-id 2.2.2.2 β conflitto con R2 che usa lo stesso RID
π Come identificarlo:
R1# show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
...
R2# show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
β stesso RID su entrambi i router!
π§ Fix:
R1# conf t
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# end
R1# clear ip ospf process β necessario per applicare il nuovo RID
PerchΓ© funziona: il Router ID OSPF deve essere univoco nel dominio OSPF. Con due router con lo stesso RID, i router scartano i LSA dell'altro perchΓ© credono di essere lo stesso router. Il nuovo RID entra in vigore solo dopo clear ip ospf process.
BUG 3
R2: wildcard mask errata nel network statement β LAN non annunciata
π Come identificarlo:
R2# show run | section router ospf
router ospf 1
router-id 2.2.2.2
network 10.0.0.0 0.0.0.3 area 0
network 10.2.0.0 0.0.255.255 area 0 β wildcard /16 invece di /24!
R1# show ip route
β nessuna rotta O 10.2.0.0
π§ Fix:
R2# conf t
R2(config)# router ospf 1
R2(config-router)# no network 10.2.0.0 0.0.255.255 area 0
R2(config-router)# network 10.2.0.0 0.0.0.255 area 0
PerchΓ© funziona: la wildcard mask 0.0.255.255 corrisponde a una /16 (255.255.0.0) β troppo ampia. L'interfaccia Gi0/0 con IP 10.2.0.1/24 rientrava comunque nella wildcard ma il problema Γ¨ che OSPF annunciava la rete come /8 o /16 invece di /24. La wildcard corretta per una /24 Γ¨ 0.0.0.255.
π§ Come ragionare su un problema OSPF
Il sintomo Γ¨: R1 e R2 non si vedono come neighbor OSPF. Da dove inizi?
Passo 1 β Verifica il Layer 1/2
show ip interface brief β l'interfaccia Γ¨ up/up? Se Γ¨ down/down Γ¨ un problema fisico. Se Γ¨ up/down Γ¨ un problema di protocollo (encapsulation mismatch su seriali).
Passo 2 β Controlla i neighbor OSPF
show ip ospf neighbor β lista vuota = mai formato neighbor. Se c'Γ¨ un neighbor in stato INIT o EXSTART c'Γ¨ un problema di comunicazione bidirezionale o RID conflict.
Passo 3 β Controlla le interfacce OSPF
show ip ospf interface β cerchi "No Hellos (Passive interface)" e verifica area, timer Hello/Dead, network type.
Passo 4 β Routing table
show ip route β se l'adjacency Γ¨ FULL ma mancano rotte, controlla i network statement e le wildcard mask con show run | section router ospf.
π Concetti chiave β OSPF
Router ID (RID)
Identificatore univoco del router nel dominio OSPF.
PrioritΓ : 1) router-id manuale, 2) IP piΓΉ alto su loopback, 3) IP piΓΉ alto su interfaccia fisica
Deve essere univoco β duplicato causa instabilitΓ
passive-interface
Blocca l'invio/ricezione di Hello OSPF sull'interfaccia.
β
Usa su interfacce LAN (verso host, non router)
β Mai su interfacce verso altri router OSPF
La rete viene comunque annunciata in OSPF
Wildcard Mask
Inverso della subnet mask:
/24 β 0.0.0.255
/30 β 0.0.0.3
/16 β 0.0.255.255
/32 β 0.0.0.0
Stati OSPF neighbor
DOWN β INIT β 2-WAY β EXSTART
β EXCHANGE β LOADING β FULL
FULL = adjacency completa β
Stuck in EXSTART = RID conflict
π Teoria β Bug 1: passive-interface sull'interfaccia WAN
Cosa fa passive-interface
Il comando passive-interface istruisce OSPF a non inviare pacchetti Hello su quella interfaccia. Senza Hello, nessun altro router puΓ² scoprire questo router come neighbor. Γ come parlare in una stanza vuota β nessuno risponde perchΓ© non sente nulla.
L'interfaccia continua a contribuire la rete al LSA del router, ma non forma adjacency.
Quando usarlo correttamente
passive-interface default β rende passive tutte le interfacce, poi si abilitano solo quelle verso router OSPF con no passive-interface <iface>. Γ la best practice per sicurezza β evita che host nella LAN ricevano Hello OSPF.
π Teoria β Bug 2: Router ID duplicato
PerchΓ© il RID deve essere univoco
OSPF usa il Router ID per identificare i LSA (Link State Advertisement). Se due router hanno lo stesso RID, ognuno scarta i LSA dell'altro pensando siano propri (loop detection). Il risultato Γ¨ che l'adjacency non si stabilizza o rimane in stato EXSTART/EXCHANGE.
Selezione automatica del RID
Se non configurato manualmente, IOS sceglie il RID in questo ordine:
1. IP piΓΉ alto tra le loopback attive
2. IP piΓΉ alto tra le interfacce fisiche attive
Best practice: configura sempre il RID manualmente con router-id X.X.X.X e usa un'interfaccia loopback come backup.
π Teoria β Bug 3: Wildcard mask errata nel network statement
Come funziona il network statement OSPF
Il comando network <ip> <wildcard> area <x> abilita OSPF su tutte le interfacce il cui indirizzo IP rientra nel range definito da ip+wildcard. Se la wildcard Γ¨ troppo ampia o troppo stretta, l'interfaccia potrebbe non venire inclusa o venire inclusa in modo errato.
Calcolo wildcard mask
Wildcard = 255.255.255.255 β subnet mask
/24 (255.255.255.0) β 255.255.255.255 β 255.255.255.0 = 0.0.0.255
/30 (255.255.255.252) β 255.255.255.255 β 255.255.255.252 = 0.0.0.3
/16 (255.255.0.0) β 255.255.255.255 β 255.255.0.0 = 0.0.255.255 β bug!
show ip ospf neighbor β adjacency FULL? Lista vuota?
show ip ospf interface β passive? area? timer?
show ip ospf β RID, process, reti annunciate
show ip route β rotte O presenti?
show run | section router ospf β network stmt, wildcard, passive
π¬π§ English version β same content with Cisco official terminology for CCNA exam preparation.
BUG 1
R1: passive-interface configured on Se0/0/0 β no OSPF Hellos sent
π How to identify:
R1# show ip ospf interface Serial0/0/0
Serial0/0/0 is up, line protocol is up
Internet Address 10.0.0.1/30, Area 0
No Hellos (Passive interface)
π§ Fix:
R1# configure terminal
R1(config)# router ospf 1
R1(config-router)# no passive-interface Serial0/0/0
Why this works: The passive-interface command prevents OSPF from sending Hello packets on that interface. No Hellos = no neighbor discovery = no adjacency. It should only be applied to LAN-facing interfaces (toward hosts), never toward OSPF-speaking routers.
π Key concept β passive-interface
β’ Suppresses Hello packets on the configured interface
β’ The network is still advertised in OSPF LSAs
β’ Best practice: passive-interface default + no passive-interface <WAN-iface>
β’ Use on stub networks (LANs with no OSPF neighbors)
BUG 2
R1: router-id 2.2.2.2 β duplicate RID conflict with R2
π How to identify:
R1# show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2 β same as R2!
R2# show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2 β duplicate RID!
π§ Fix:
R1# configure terminal
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# end
R1# clear ip ospf process β required to apply new RID
Why this works: The OSPF Router ID must be unique across the OSPF domain. With duplicate RIDs, routers discard each other's LSAs (loop prevention mechanism). The adjacency gets stuck in EXSTART/EXCHANGE state. The new RID only takes effect after clear ip ospf process.
π Key concept β OSPF Router ID selection
Priority order (highest to lowest):
1. Manually configured: router-id X.X.X.X
2. Highest IP on active loopback interfaces
3. Highest IP on active physical interfaces
Always configure manually for predictability and stability.
BUG 3
R2: wrong wildcard mask in network statement β LAN not advertised
π How to identify:
R2# show run | section router ospf
router ospf 1
router-id 2.2.2.2
network 10.0.0.0 0.0.0.3 area 0
network 10.2.0.0 0.0.255.255 area 0 β /16 wildcard, should be /24!
R1# show ip route ospf
β no route to 10.2.0.0/24
π§ Fix:
R2# configure terminal
R2(config)# router ospf 1
R2(config-router)# no network 10.2.0.0 0.0.255.255 area 0
R2(config-router)# network 10.2.0.0 0.0.0.255 area 0
Why this works: The wildcard mask in OSPF network statements defines which interfaces to activate OSPF on. A /24 network (255.255.255.0) requires wildcard 0.0.0.255. Using 0.0.255.255 matches a /16 range β OSPF would still activate on Gi0/0 but advertise incorrectly. Always calculate: wildcard = 255.255.255.255 β subnet mask.
π Key concept β Wildcard mask calculation
Formula: wildcard = 255.255.255.255 β subnet mask
/24 (255.255.255.0) β 0.0.0.255
/30 (255.255.255.252) β 0.0.0.3
/16 (255.255.0.0) β 0.0.255.255 β this was the bug
/32 (255.255.255.255) β 0.0.0.0
π―
Exam Practice β OSPF Troubleshooting
3 questions Β· CCNA 200-301 style Β· answer before checking
0/3
Q1.
A network administrator runs show ip ospf interface Serial0/0/0 and sees the message "No Hellos (Passive interface)". What is the most likely impact on OSPF?
A) OSPF will still form adjacency but will not send routing updates
B) The router cannot form an OSPF adjacency on this interface because no Hello packets are sent
C) The interface is shut down and needs to be enabled with no shutdown
D) OSPF Hello packets are being sent but not acknowledged by the neighbor
Q2.
Two routers are configured with OSPF but the adjacency is stuck in EXSTART state. show ip ospf reveals both routers have Router ID 1.1.1.1. What is the correct action?
A) Change the OSPF process ID on one router to resolve the conflict
B) Configure a unique router-id on one router, then issue clear ip ospf process
C) Reload both routers simultaneously to reset OSPF state
D) Change the OSPF area on one router to a different area number
Q3.
A router has the following OSPF configuration:
network 192.168.10.0 0.0.255.255 area 0
The interface Gi0/1 has IP address 192.168.10.1/24. Which statement is true?
A) OSPF will not activate on Gi0/1 because the wildcard mask is wrong
B) OSPF will activate on Gi0/1 and advertise the network correctly as /24
C) OSPF will activate on Gi0/1 but the wildcard 0.0.255.255 matches a broader range than intended β the correct wildcard for /24 is 0.0.0.255
D) The network statement is only valid if the subnet mask matches exactly